Download presentation
Presentation is loading. Please wait.
2
1 Lab Session-III CSIT121 Fall 2000 Setting Your Own Paths Setting Project Information Browse Information Generation Data types revisited Enumerated data types Manipulators
3
2 Setting Your Own Paths The default paths are already set For changing source file path, Go to Tools-- >Options Select Directories Tab and input your own path Try the other Tabs and see what you can make out of these (Tabs, Compatibility, Format:)
4
3 Setting Project Information Select Project-->Settings Go to C/C++ Tab. Can you optimize your program for speed? What happens if Warnings as Errors is checked?
5
4 Browse Information Generation You can create a browse information file for each project This file has an extension.bsc This enables you to find out where in your source code any item is used and where it is defined
6
5 Browse Information Generation Go to Project-->Settings-->C/C++ Click on the Generate Browse Info checkbox Switch to Browse Info Tab Click on Build Browse Info checkbox
7
6 Browse Information Generation You can use the browse information file when you are browsing your source code Go to any item in your source code (for example a variable or a function call) Press right mouse button to see a menu Select Go to Definition --- or Go to Reference--- If the browse file is not available, it will be generated (Practice Temp. Program:Tools)
8
7 Data Types Revisited C++ is case sensitive Boolean variables are assigned values true and false and not TRUE and FALSE TRUE and FALSE carry the values 0 and 1 and these can be used with variables of type integer Write a program that asks if you have apples. A boolean variable is changed as per response and then used to print output
9
8 Enumerated Data Types Some data has only a limited set of values that can be referred by labels For example, months in a year, days in a week, desserts in a restaurant menu Enumerated data types can be defined by the user For example enum days_of_week {sun, mon, tue, wed, th, fri, sat}
10
9 Manipulators A manipulator modifies the way in which data input or output is handled For using manipulators, we need to put #include Try outputting numbers like below cout << setw(8) << num1 << setw(8) <<num2
11
10 Lab Exercises Define today as Sunday and print “Hoorrah” if ( today == sun) Print the following data in a nice format showing columns of serial numbers and data values: (28.45, 32, 334.51, 16.7, 99.1, 2334.65, 12, 13.34, 8.2, 98.4)
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.