Hello, I'm a newbie to programming. I've worked through a basic unix book, applescript and ruby(beginner). Now I've taken the plunge into a c++ class at my local community college, but I keep having trouble doing the stuff from Visual Studio in class to my Mac at Home. This is the first code we ran at school and the cin.ignore(99,'\n') keeps the command open to show the output on the command line, but it doesn't work for me on my mac. when I take out the cin.ignore(99,'\n'), the program runs, but I can't view the output. Is there any alternatives to this?
This is how my program looks:
#include<iostream>
using namespace std;
int main(void)
{
cout << "Hello, World!!!";
cin.ignore(99,'\n');
return 0;
}
I'll run the program in the terminal with
g++ filename.cpp
This is how my program looks:
#include<iostream>
using namespace std;
int main(void)
{
cout << "Hello, World!!!";
cin.ignore(99,'\n');
return 0;
}
I'll run the program in the terminal with
g++ filename.cpp