There is no syntax error here:
Sometimes I get this and it is exactly what it is supposed to be :Code:#include <iostream> #include <stdlib.h> #include <string> using namespace std; class A { public: void get_input(); } void main() { A obj1,obj2; cout<<"Input 1:"; obj1.get_input(); cout<<"Input 2:"; obj2.get_input(); } void A::get_input() { char Array[10]; cin.getline(Array,10); }
but I get this sometimes:Code:Input 1://get input 1 first Input 2://then get input 2
What's wrong with it?Code:Input 1:Input 2: