Compiles okay, but doesn't run.

This is a discussion on Compiles okay, but doesn't run. within the C++ Programming forums, part of the General Programming Boards category; Think about it this way: argc is an int given to your program representing the number of command line arguments ...

  1. #16
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Think about it this way: argc is an int given to your program representing the number of command line arguments (including the program name). Thus for foo bar bas, argc = 3. argv, on the other hand, is a character array representing the arguments themselves. Thus, argv[0] is your program's name. For foo bar bas, argv[0] = "foo", argv[1] = "bar", and argv[2] = "bas". When VC++ compiles your program, it by default provides no arguments. Thus your program recognizes this and quits.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  2. #17
    Registered User
    Join Date
    Oct 2006
    Location
    London
    Posts
    14
    karlawarla: are you studying at University of Westminster?;p

  3. #18
    c++ beginner so be nice! karlawarla's Avatar
    Join Date
    Nov 2006
    Location
    West London, UK
    Posts
    33
    Yup, are you??
    Microsoft: "You have questions, we having dancing paperclips"

  4. #19
    c++ beginner so be nice! karlawarla's Avatar
    Join Date
    Nov 2006
    Location
    West London, UK
    Posts
    33
    manutd, thank you for your post, i'll take note. :-)
    Microsoft: "You have questions, we having dancing paperclips"

  5. #20
    Registered User
    Join Date
    Oct 2006
    Location
    London
    Posts
    14
    karlawarla: ye, Internet Computing course;p

  6. #21
    c++ beginner so be nice! karlawarla's Avatar
    Join Date
    Nov 2006
    Location
    West London, UK
    Posts
    33
    kool, i'm doing the visualisation course, but taken programming methodology as my free choice, hence all the c++ questions lol
    Microsoft: "You have questions, we having dancing paperclips"

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calculating the mode
    By bigggame in forum C Programming
    Replies: 10
    Last Post: 06-13-2006, 04:04 AM
  2. My program compiles, but does not run
    By Surfer_Rosa in forum C++ Programming
    Replies: 4
    Last Post: 05-13-2006, 11:25 AM
  3. How I can Run exe file in C++
    By palang in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2006, 12:55 PM
  4. MSVC: run w/o debugger vs run w/ debuger
    By skorman00 in forum C++ Programming
    Replies: 2
    Last Post: 01-24-2006, 09:49 PM
  5. Replies: 2
    Last Post: 10-29-2002, 04:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21