Quit being mean to me because I don't know the difference between C and C++. =p
Anyhow, I almost fixed it again. I tested it too.
#include <iostream>
using namespace std;
int main() { //I always put the start bracket on the same line, oh well. =)
char filetype;
char change[10];
float byte = 8;
float megabyte = 1048576;
float gigabyte = 1072741824;
cout << "This program is designed to convert byte, kilobyte, megabyte, and gigabyte into different file sizes." << endl;
cout << endl;
cout << "What file size are you wanting to be converted?" << endl;
cin >> filetype;
switch(filetype) { //use switch (vb's select case) instead of if, because if == ugly
case "byte": { //again, your using a string constant, not a variable, so it needs to be in quotes
cout << "What do you want to change it into?"<<endl;
cin >> change;
switch(change) {
case "kilobyte": {
cout << "1024 bytes in a Kilobyte" << endl;
} //end byte>>kilobyte case
default: {
cout << "Type not recongnized." << endl;
} //end byte>?? case
} //end switch for byte>>type
} //end byte case
default: {
cout << "Type not recongnized." << endl;
} // end ?? case
} //end switch for type
return 0xDEADBEEF; //ok, thats just leet..
}
joe@JoeMomma:~/dev/cpp/helloworld $ gcc Main.cpp
Main.cpp: In function `int main()':
Main.cpp:17: error: case label does not reduce to an integer constant
Main.cpp:20: error: switch quantity not an integer