Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
here is the code where im having the problem. the problem arises when i get to the commands cout and cin, where the debugger (and compiler, which is GNU) see the commands as undeclared variables. Please tell me the problem and solution. thanks.

#include (cstdio)
#include (cstdlib)
#include (iostream)
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
     int nNumber;
     int nNumber2;
     
     cout << "numero uno - " << endl;
     cin >> nNumber;
     
     cout << "nombre du - " << endl;
     cin >> nNumber2;
     
     cout << "the equation = \n" << endl;
     cout << (nNumber - nNumber2 * nNumber) + 5;
     cout << "\n" << endl;
     system("PAUSE");
     return 0;

}


[edit]Code block added - OriginalGriff[/edit]
Posted
Updated 15-Jun-11 9:16am
v2
Comments
Sergey Alexandrovich Kryukov 15-Jun-11 16:08pm    
Commands? There are no commands. This is not a small detail. Incorrect terminology -- poor programming.
--SA

Do you actually use the round brackets (i.e '()') to include header files?
You should use the inequality signs (i.e. '<>'), for instance
C++
#include <iostream>
//..
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 15-Jun-11 16:06pm    
They are called "angular brackets". inequality sign is "!=", (yes, in Pascal it's "<>").
--SA
CPallini 16-Jun-11 2:58am    
http://en.wikipedia.org/wiki/Bracket
Sergey Alexandrovich Kryukov 17-Jun-11 21:38pm    
http://en.wikipedia.org/wiki/Emoticon
lowpro 15-Jun-11 16:19pm    
thank you. the book i was using was not very clear.
CPallini 16-Jun-11 2:59am    
You are welcome.
Normally the syntax for the include would either be:

#include <cstdio.h>

or

#include "cstdio.h"


Not sure what happens when you put it in parenthesis. cout and cin should be defined in iostream.h
 
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