Post the code in code tags.
What is the problem? I mean apart from the class csh1 doesn't seem to have member "words" and the member "integers" is declared as a single int
Did you even try to compile this? As codewalker said, convert.words doesn't exist. convert.integers; does nothing.
Did you mean to call your function?
convert.number(); // This is a function call
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
#include<iostream>
usingnamespace std;
class csh1{
public:
void number(){//why not make this function void, since you're not returning anything
/*int integer[9];take away this array, it does nothing, just waist dataspace*/
int integers; /*if you see in integers, then compare integers, otherwise you're comparing random numbers in a uninitialized array*/
for( int c=0;c<=9;c++){
cin>>integers;
if(integers==0){
cout<<"zero"<<endl;
}
elseif(integers==1){
cout<<"one"<<endl;
}
elseif(integers==2){
cout<<"two"<<endl;
}
elseif(integers==3){
cout<<"three"<<endl;
}
elseif(integers==4){
cout<<"four"<<endl;
}
elseif(integers==5){
cout<<"five"<<endl;
}
elseif(integers==6){
cout<<"six"<<endl;
}
elseif(integers==7){
cout<<"seven"<<endl;
}
elseif(integers==8){
cout<<"eight"<<endl;
}
elseif(integers==9){
cout<<"nine"<<endl;
}
else{
cout << "not a number from 0 to 9" << endl;
}
}
}
};
int main(){
csh1 convert;
/*I would say, stay away from classes and objects, until you learn the
basics, especially using else if instead of if if if...
convert.words;
convert.integers;
also neither words or integers is a function class member of csh1*/
convert.number(); // this one is, and its what you should call
return 0;
}
I would have used switch statements as well, but you should pace down and learn things one at a time... Read a lot of literature and ask around the forums, but try to build things the right way according to what you've learned and pay attention to detail, and you won't need help... cheers! :)
Oh yeah and learn about indenting! makes our work of helping you solve things a lot easier! most IDE's have commands for indenting just check the help tab, or setting and again cheers! :)