• Advertisement
Sign in to follow this  

No output

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, Jack here. I made this program that takes the entry names in the command line and says hello to each one, and it compiles just fine, but when I run it, I get no output. Here's the code: #include <iostream> #include <cstring> using namespace std; int main (int argc, char *argv[]) { for (int rep = 1; rep > argc; rep++) { cout << "Hello " << argv[rep] << endl; } return 0; } Any suggestions? Thanks. -TJ

Share this post


Link to post
Share on other sites
Advertisement
You may already know this, but a common ailment is that the window just closes right away -- you can resolve this by putting a simple cin.get() before the return 0 and it will wait for the user to strike enter before it ends.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement