Ms Visual Studio Users.. Help With Debugging!?

Discussion in 'General Car Audio Discussions' started by geolemon, Nov 17, 2003.

  1. geolemon

    geolemon Full Member

    I thought we had some resident IT geeks on the forum...
    Hopefully someone can help me out!

    I'm taking a class in C right now, trying to use the C++ compiler for it (saving the class file as a .c extension does the whole trick... C99 standards and all).

    But anyway, I've written a program that couldn't be any more typical college exercise...
    A number is passed in as input, so my function expects an integer.

    The function calculates out how many numbers are prime numbers, counting from 1 up to the number passed in.

    So, I want to debug this thing...
    And I can't find in Visual Studio (or at least in my C project, in the C++ IDE) where I put the value of that variable...

    So far all I've done is set a breakpoint right after my function declaration, and actually edit the variable's value before the thing gets going... but that seems quite retarded, I know there's a "real" way to pass the damn thing in.

    Right now, inexplicably, it's currently passing in a 2 for that integer value, for no good reason. I can't find any project settings that are currently set to 2 even.

    Aarrgh.
    :bag:
     
  2. sandt38

    sandt38 Full Member

    Uhhmmmmm, ,yeah. Sorry Geo, I still have issues typing my last name first when it is plainly labled on the screen. I just don't think my advice would help any LOL... Ask Mikey
     
  3. The_Ancient

    The_Ancient Full Member

    sorry i dont know the First thing about C or C++, I have thought about taking a class for it, but never have

    I would go to a Visual Basic Forum and ask them, I am sure they will have alot more knowelge about it than me, I am more of a Web Scripter, than a Computer programmer
     
  4. chadillac3

    chadillac3 Full Member

    Hehe; I think I had to do the exact same program in my freshman C++ course at UT. Can't remember how to do it, to be honest, since it's been about 6 years. The fun stuff is when you convert from C to assembly and machine code. :)
     
  5. systempimp_1500

    systempimp_1500 Full Member

    I know VB very well, but not the first thing about C++.

    Sowwy baby.





    Jeff
     
  6. systempimp_1500

    systempimp_1500 Full Member

    hm hm

    cool stuff

    binary is definately cool to understand. The formulas to it are really pretty easy,

    it just sucks having to type 400 character lines over and over and over and over...

    which is why assembly is better :yes:




    Jeff
     
  7. geolemon

    geolemon Full Member

    I had the biggest genious idea, to get me past this hurdle.
    Eventually, I'd like to know how to do this [pass in command line arguments for the debugger], but...

    For now, I'm going to change the program so that it fires up, and prompts the user to input the number. Sounds more user-friendly anyway. Should be good for a few brownie points. :yes:
     
  8. systempimp_1500

    systempimp_1500 Full Member

    sounds good to me.

    it should debug it automatically when there's an error anyways though when you

    try to run it.

    To help a little, declare the entire program as 'option explicit'.

    That will inform you of run in problems as they occur, instead of having to

    search for them.





    Jeff
     
  9. geolemon

    geolemon Full Member

    Good point...
    I'm supposed to be "option explicit"ing these.. B)

    Regardless, the debugger is working, I just can't figure out where to configure command line parameters to pass..

    ie. in application, you'd type something like:
    > MyProgram.cmd -o12

    I want to know how to launch the program with the command line parameters, for the debugger. ;)