Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: C/C++ help needed.

  1. Registered TeamPlayer hannibal's Avatar
    Join Date
    08-20-07
    Location
    Tempe, Arizona, United States
    Posts
    1,418
    Post Thanks / Like
    Blog Entries
    2
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    PSN ID: aws4y Steam ID: hannibal_smith_1984 hannibal's Originid: hannibal_smith15
    #11

    Re: C/C++ help needed.

    VS is almost required for professional coders, if you cant get access through MSDNAA, try this

    http://www.dreamspark.com/


    Eclipse is a jack of all trades IDE, you can use it to do anything, the drawback is a steep learning curve. For most people I recomend a good linux environment with GCC and emacs, it helps you understand what all is going on, not that GCC is very good. I used to recomend netbeans IDE for beginners, but oracle has made that IDE basically worthless. To be hones on windows CYGWIN + Emacs 23 is a good way to go you can find them here

    Cygwin

    Download Latest EmacsW32+Emacs binaries and nXhtml

    at least until you get used to the code->compile->run->debug->code cycle.

    -H

    Standard Disclaimer: 150% of what I say is bullshit.

  2. Registered TeamPlayer rush2049's Avatar
    Join Date
    03-26-11
    Location
    Lancaster, PA
    Posts
    1,213
    Post Thanks / Like
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    Gamertag: Benjamin Rush PSN ID: Benjamin_Rush Steam ID: rush2049 rush2049's Originid: rush20492002
    #12

    Re: C/C++ help needed.

    Well to not answer your question: netbeans for java hands down.....

    I haven't played too much with C/C++ in netbeans, but if it is anything like their ruby implementation then stay away....

    Visual Studio is the best.... and yes its clunky and bloated, but it will do the best job almost every time.
    -- Intentionally Left Blank --

  3. Registered TeamPlayer i8pptuakamonstercam's Avatar
    Join Date
    11-26-06
    Location
    Anywhere you want to be.
    Posts
    3,946
    Post Thanks / Like
    Blog Entries
    1
    Stat Links

    C/C++  help needed.
    #13

    Re: C/C++ help needed.

    I just want to say thanks to hannibal for the linked site and everyone else for their information and views on the subject.

    I know have VS 2010 pro im a balla lol

    P.S.
    Does anyone know how to display console output that does not immeadiately go away?
    I tried starting without debugging thinking that the "Press any key to continue"(or something like that) would come up and I could actually see what the output was.
    (This is in MSVSpro)
    Last edited by i8pptuakamonstercam; 05-12-11 at 07:37 PM.

  4. Registered TeamPlayer i8pptuakamonstercam's Avatar
    Join Date
    11-26-06
    Location
    Anywhere you want to be.
    Posts
    3,946
    Post Thanks / Like
    Blog Entries
    1
    Stat Links

    C/C++  help needed.
    #14

    Re: C/C++ help needed.

    sorry for double post, but regarding the problem I had above I have figured out the solution to it!

    So if anyone needs help with it just ask, because it is a really annoying problem to have.

  5. Registered TeamPlayer hannibal's Avatar
    Join Date
    08-20-07
    Location
    Tempe, Arizona, United States
    Posts
    1,418
    Post Thanks / Like
    Blog Entries
    2
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    PSN ID: aws4y Steam ID: hannibal_smith_1984 hannibal's Originid: hannibal_smith15
    #15

    Re: C/C++ help needed.

    the command is

    system("pause");

    This will halt at the end and ask you to "press any key to continue..." You can put it just before:

    return 0;
    That is where I have it in most of my programs.
    -H
    Last edited by hannibal; 05-12-11 at 09:02 PM.

    Standard Disclaimer: 150% of what I say is bullshit.

  6. Administrator Bunni's Avatar
    Join Date
    08-29-07
    Posts
    14,279
    Post Thanks / Like
    Blog Entries
    7
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    Steam ID: bunni Bunni's Originid: Dr_Bunni
    #16

    Re: C/C++ help needed.

    Quote Originally Posted by hannibal View Post
    the command is

    system("pause");

    This will halt at the end and ask you to "press any key to continue..." You can put it just before:

    return 0;
    That is where I have it in most of my programs.
    -H
    ehhhhhh, not to flame, snobby c++ programers would yell at you, im tempted and guess i kind'a am (for which i apologize). It is technically a bad habbit to start him on especially if hes gonna be doing any program for School or Professional he'll get frowned on.

    Its expensive, the system() method suspends the program-> goes to the os->opens shell-> os has to locate the string'ed "pause" command-> allocates memory for the cmd-> waits for the key-> deallocates the mem-> resumes your program. SO its very very ugly, even if modern computers can handle it, its bad form (and lazy) to burn mem and cpu just because modern computers have ample resources. That ideology, is a huge deciding factor for company interviewers to drop candidates for.


    Use a break point, or cin.get()


    Damn guess im one of those snobby programmers now. :<

  7. Registered TeamPlayer hannibal's Avatar
    Join Date
    08-20-07
    Location
    Tempe, Arizona, United States
    Posts
    1,418
    Post Thanks / Like
    Blog Entries
    2
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    PSN ID: aws4y Steam ID: hannibal_smith_1984 hannibal's Originid: hannibal_smith15
    #17

    Re: C/C++ help needed.

    Quote Originally Posted by Bunni View Post
    ehhhhhh, not to flame, snobby c++ programers would yell at you, im tempted and guess i kind'a am (for which i apologize). It is technically a bad habbit to start him on especially if hes gonna be doing any program for School or Professional he'll get frowned on.

    Its expensive, the system() method suspends the program-> goes to the os->opens shell-> os has to locate the string'ed "pause" command-> allocates memory for the cmd-> waits for the key-> deallocates the mem-> resumes your program. SO its very very ugly, even if modern computers can handle it, its bad form (and lazy) to burn mem and cpu just because modern computers have ample resources. That ideology, is a huge deciding factor for company interviewers to drop candidates for.


    Use a break point, or cin.get()


    Damn guess im one of those snobby programmers now. :<
    I really don't want to get into a flame war, but he is a beginning programmer, and who on Earth win32 console apps anyway. While I agree with the sentiment bunni, in this case I don't think it matters that much. Besides this command only works on windows systems.

    -H

    Standard Disclaimer: 150% of what I say is bullshit.

  8. Administrator Bunni's Avatar
    Join Date
    08-29-07
    Posts
    14,279
    Post Thanks / Like
    Blog Entries
    7
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    Steam ID: bunni Bunni's Originid: Dr_Bunni
    #18

    Re: C/C++ help needed.

    Quote Originally Posted by hannibal View Post
    I really don't want to get into a flame war, but he is a beginning programmer, and who on Earth win32 console apps anyway. While I agree with the sentiment bunni, in this case I don't think it matters that much. Besides this command only works on windows systems.

    -H
    i hear ya. Theres nothing wrong with system("") when you use it correctly and when needed. But mise as well tell him now, no point in starting a really bad habbit and or having him using it trivially.

    Right yah, system calling pause only works on windows, again another downside of using system to pass commands :<. Cin.Get() though will work on any os with the standard iostream library (linux (looking at g++ and ming both have it) and windows i know for fact, dunno about mac...might have to use cin.getline....).

    But to get to the nitty-gritty, without looking at the code for window's "pause" command, i damn near guarantee its using cin.get or getchar. Either way, why use the middle man to do something that your console app is designed to do? Like calling for a tow-truck to pick you and your car up and drop you and your car off at your work place, when theres nothing wrong with your car? You gotta call the tow-truck, you gotta wait for it, gotta load your car on, gotta get to work, gotta unload, and finally have to pay the man...

    Really for prose, you should reserve system for when you actually need to communicate with the higher layers of the os in a sense (not to mention 'system' invokes a command processor), for example, if you want open a file with the os's set default open app for that extension (for example open a image with whatever the user has set to open that image type), or open explorer/komand to a folder, etc. But if your just looking to get input (any key), cin for something, anything.

    Your gonna have to use cin some time anyways, starting now will be good practice and in all likely hood if for a console app you practically have to have included iostream, but for system youll have to include stdlib. Plus doing so (using cin to halt console from terminating) will be good practice and if you ever have to post your code on any website for help you wont get other coding form nazi's calling you out on it....






    Heres some examples of possible source for windows' pause command:




    And why not to use system("pause"):


  9. Registered TeamPlayer hannibal's Avatar
    Join Date
    08-20-07
    Location
    Tempe, Arizona, United States
    Posts
    1,418
    Post Thanks / Like
    Blog Entries
    2
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    PSN ID: aws4y Steam ID: hannibal_smith_1984 hannibal's Originid: hannibal_smith15
    #19

    Re: C/C++ help needed.

    Ok bunni you win, I must say that arguments like this one are why I left CS for Math, I would much prefer to have a substantive conversation about whether or not zero is a natural number.

    -H

    Standard Disclaimer: 150% of what I say is bullshit.

  10. Administrator Bunni's Avatar
    Join Date
    08-29-07
    Posts
    14,279
    Post Thanks / Like
    Blog Entries
    7
    Stat Links

    C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed. C/C++  help needed.
    Gamer IDs

    Steam ID: bunni Bunni's Originid: Dr_Bunni
    #20

    Re: C/C++ help needed.

    Quote Originally Posted by hannibal View Post
    Ok bunni you win, I must say that arguments like this one are why I left CS for Math, I would much prefer to have a substantive conversation about whether or not zero is a natural number.

    -H
    Not to be a dick, or trolling, or __ , but to really clarify my point that calling the pause command via system is a belabored cin.get(). Which then the loads of steps inbetween system("pause") and cin.get() are wasted work in comparison to a direct cin.get() call. I forget where pause is, probably in cmd.exe, but if you wanted to decompile and step through, id wager ALOT, that pause.cmd IS cin.get, because it HAS to be. Pause waits for input from standard input, standard input stream is cin (istream). So pause is nothing more than a 5 line c/c++ program, that prints "press a key" and waits for it via cin. And thats my point, instead of invoking all that garbage just to skip 2 or 3 lines of code at most, is silly, right? Especially when those 2-3 lines are essential skills for console applications anyways and since our applicant is learning c++, perfect opportunity too .

    You'd have loved my Stochastic graduate Math class the other semester, sooooo much discussions on various mathematical theorems, hypothesizes and what not.

    /offtopic But as for 0, mathematical theorems are set down by man, whom is as history has shown is chronically flawed. In otherwords, the rules behind which numbers are within the natural set are too ambiguous and vague regarding 0 (mostly because there's no globally accepted definition on natural numbers), as a result there is no right answer and subsequently no reason to converse about it (because if there was a right answer, it would have been accepted a long time ago, thus there is no right answer), unless you are referring to specific contextual definition of natural numbers...


Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Title