Some of you might remember my previous thread about Interface Builder...well I've been trying to get back to the basics and actually learn C++.
I'm using Xcode 3.1 in OS 10.5.8.
Basically I'm trying to compile this, and then subsequently change things to get a different output:
I'm compiling in Terminal using g++. However, g++ returns these errors:
Bear in mind that I'm a pretty rank n00b at this. I can't figure out what needs to be done to fix the errors, or if I'm missing a syntax error or have done something in my code. I know that these things should be declared, but how?
Many thanks for any help/advice!
I'm using Xcode 3.1 in OS 10.5.8.
Basically I'm trying to compile this, and then subsequently change things to get a different output:
Code:
#include<iostream>
using namespace std;
int main( int argc, char *argv[]) {
char myCharacter = 'z';
cout << "The datatype is " << sizeof(int) << " bytes!" << endl;
cout << "The variable has a value of " << myCharacter << endl;
return 0;
}
I'm compiling in Terminal using g++. However, g++ returns these errors:
Code:
program2.cpp: In function ‘int main(int, char**)’:
program2.cpp:16: error: ‘end1’ was not declared in this scope
program2.cpp:17: error: ‘z’ was not declared in this scope
Bear in mind that I'm a pretty rank n00b at this. I can't figure out what needs to be done to fix the errors, or if I'm missing a syntax error or have done something in my code. I know that these things should be declared, but how?
Many thanks for any help/advice!