sail3005
Feb 9th, 2001, 09:54 PM
Hi, i am trying just to get classes down, and i think the class itself is ok. But whenever i try to compile this code i get errors about casting a and b to a char. They already are a char! I have no idea what is wrong.
I know the code is useless and pointless, like i said, i am just trying to get this down.
#include <iostream.h>
class Func {
public:
void Welcome(char name);
};
void Func::Welcome(char name) {
cout<<"Welcome to my program"<<name<<endl;
}
char a = "Hi";
char b = "Hello";
int main(){
Func Start;
Start.Welcome(a);
Start.Welcome(b);
return 0;
}
Thanks A LOT for any help! :)
I know the code is useless and pointless, like i said, i am just trying to get this down.
#include <iostream.h>
class Func {
public:
void Welcome(char name);
};
void Func::Welcome(char name) {
cout<<"Welcome to my program"<<name<<endl;
}
char a = "Hi";
char b = "Hello";
int main(){
Func Start;
Start.Welcome(a);
Start.Welcome(b);
return 0;
}
Thanks A LOT for any help! :)