Sign in to follow this  
TraderJack

No output

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this