Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
1.14/5 (7 votes)
See more:
how to indicate variables in c++ ?
Posted
Comments
Thomas Daniels 9-Feb-13 11:39am    
What do you mean exactly?
Sergey Alexandrovich Kryukov 9-Feb-13 14:46pm    
It looks like you are too much underqualified to ask questions. In other words, learning programming by asking such questions are utterly ineffective, just a waste of time...
—SA

The syntax for simple variable declarations in C++ is
<type> <varname> [ <assignment> ];
e.g.
int a;
or
char ACharacter = 'T'

The type integer or character or one of many others says what kind of variable it will be, the name gives it an identity so you can refer to it and the optional assignment = gives it an initial value. The value assigned should of course be of the same type as the variable.
The power of C++ is in the ability not just to use the ~25 built in types that the language already knows about or sequences of them but to construct from them entirely new types which did not previously exist in the language and to use those types in every way the existing types can be used, including to construct yet further types. This power of extension is what lies behind Object Oriented programming and Patterns and many of the other 'advanced' programming techniques developed up till now.
 
Share this answer
 
Comments
Albert Holguin 12-Feb-13 13:36pm    
+5
Try to use this tutorial http://www.cplusplus.com/doc/tutorial/[^] or similar tutorial. You are then welcome to ask questions that may appear.
 
Share this answer
 
hi,
you learn programming in any language by writing code in it and also reading the related theory and learning the data structures . So for starters, start by writing simple programs involving basic language structs like declaring variables,conditional decesion making,loops etc. then proceed to learn object oriented concepts with simple programs having classes, inheritance, etc.
you can follow how they present theory and code on following online resources :
1). http://www.tutorialspoint.com/cplusplus/index.htm[^]
2). http://www.cprogramming.com/tutorial/c++-tutorial.html[^]

i would also recommend C++ How to Program[^]

go coding !!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900