#include<iostream.h>
using namespace std;
class first
{
int reverse()
{
char name[]={'k','a','v','i','t','h','a','/0'};
int 1=0;
while(name[i] != '/0')
{
i++;
cout<<"value of i is"<<i<<endl;
}
}
int main()
{
first f;
f.reverse();
}
};
my file's name is cpp.cpp and i cannot run it using ./a.out
I get a warnings as follows:
1. multi-character character constant
2. comparison is always true due to the limited range of the data type
error:
1. in member function 'int first::reverse()':
2. undefined symbols
"_main", referenced from:
start in crt1.10.5.o
id: symbol (s) not found
collect2: Id returned 1 exit status
Can you please help me figure out as to what problem this is ?