This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: constants:-if you have variables in your program that you want to forbid from being reassigned you make it a constant const int A= 17; //if you try to change a later you will see an error. convention says that it is to be all caps-this helpful if you need to make changes later to a variable that shows up many times in your program Strings: # include <string> string z= "Bob"; cout<< z; //we would see it just print Bob because it is a string-the computer stores the string as B being 0, o being 1, and b being 2 dot notation: int c= z.length ( ); // this would set c as three because bob (z variable) is three characters long above is formatted as: object_name.member_function_name(parameters) string initial= z.substr(0,1); //the 0 is the start position and the 1 is the length-by doing something like this it would set the string initial as being bo because the parameter does not include the last b....
View Full Document
- Spring '08
- #, int c= z.length