Results 11 to 20 of 22
Thread: C/C++ help needed.
-
- Join Date
- 08-20-07
- Location
- Tempe, Arizona, United States
- Posts
- 1,418
- Post Thanks / Like
- Blog Entries
- 2
05-11-11, 04:36 AM #11Re: 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.
-
05-12-11, 04:03 AM #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 --
-
- Join Date
- 11-26-06
- Location
- Anywhere you want to be.
- Posts
- 3,946
- Post Thanks / Like
- Blog Entries
- 1
05-12-11, 07:01 PM #13Re: 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.
-
- Join Date
- 11-26-06
- Location
- Anywhere you want to be.
- Posts
- 3,946
- Post Thanks / Like
- Blog Entries
- 1
05-12-11, 07:55 PM #14Re: 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.
-
- Join Date
- 08-20-07
- Location
- Tempe, Arizona, United States
- Posts
- 1,418
- Post Thanks / Like
- Blog Entries
- 2
05-12-11, 09:00 PM #15Re: 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.
-HLast edited by hannibal; 05-12-11 at 09:02 PM.
Standard Disclaimer: 150% of what I say is bullshit.
-
05-14-11, 06:22 PM #16
Re: C/C++ help needed.
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. :<Last edited by Bunni; 05-14-11 at 06:27 PM.
-
- Join Date
- 08-20-07
- Location
- Tempe, Arizona, United States
- Posts
- 1,418
- Post Thanks / Like
- Blog Entries
- 2
-
05-15-11, 05:13 PM #18
Re: C/C++ help needed.
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"):
- http://www.gidnetwork.com/b-61.html.
- Console Closing Down - C++ Forum is also an awesome 7 page read (first two hit it pretty well)!
Last edited by Bunni; 05-15-11 at 05:18 PM.
-
- Join Date
- 08-20-07
- Location
- Tempe, Arizona, United States
- Posts
- 1,418
- Post Thanks / Like
- Blog Entries
- 2
-
05-15-11, 07:30 PM #20
Re: C/C++ help needed.
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...
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks