Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
how to indicate variables in c++ ?
Posted 9-Feb-13 5:37am
Comments
ProgramFOX at 9-Feb-13 11:39am
   
What do you mean exactly?
Sergey Alexandrovich Kryukov at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Comments
Albert Holguin at 12-Feb-13 13:36pm
   
+5
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Try to use this tutorial http://www.cplusplus.com/doc/tutorial/[^] or similar tutorial. You are then welcome to ask questions that may appear.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 !!
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,656
1 Sergey Alexandrovich Kryukov 6,400
2 CPallini 5,240
3 George Jonsson 3,584
4 Gihan Liyanage 2,625


Advertise | Privacy | Mobile
Web04 | 2.8.140921.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100