linux - Can't Change A C++ Variable After Initializing -


I am very new to C ++ and stuck with some very handy goods. I am working on Ubuntu 14.04. I have seen many examples of code like following But I only get errors.

  int x; X = 12; // output error: 'x' is not a type of name  

I want to code simple and useful but it is stuck to me. Why can not I

  int z = 12; Z = 4; // Output Error: 'z' is not a type of name  

I have followed a reasonable number of C ++ tutorials and have been successful in running the code. But now I think I can not change only one variable It makes writing code very difficult! Of course I tried the "type" variable for lines as a result of this error.

  int z = 12; Int z = 4; // Output Error: Redefine 'int jade'  

If I do and if I do not have any help with any ??

EDIT: Okay people, you are killing me with the votes I am new to the brand + C + and doing so many homework, I did not get any relief before this post. A grip is 22: can descend for ignorance and defeat ignorance without any help! Thanks for the big comments and answers now I get it.

You must put your code in a function. The main task is most likely because you are still starting the language:

  #include & lt; Iostream & gt; Int main () {int x; X = 12; // Enter whatever code is the next return 0; }  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -