• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

C++...HELP

Joined
6/6/08
Messages
1,194
Points
58
Okay I'm at a rut...

I tried bloodshed C++ but that closes on me as soon as I try to run a program, and microsoft visual C++ just confuses the living hell out of me.

In either case, I can't get even a Hello World program to run correctly.

Is there some simple C++ compiler out there for me to just sit down and start coding again?

I had one course in C++ but it was so poorly taught and didn't teach me where I'd use this (literally all the stuff could be done 10x faster in excel) and so I forgot it all by now and am trying to relearn from the ground up.

Can someone please point me in the way of getting started for a C++ newbie? I know I need it to get into finance, but it's really my greatest barrier. All help is greatly appreciated.

Thanks a lot in advance.
 
I know you said MS Visual C++ confuses you, but it's pretty easy to get started writing simple console apps, at least. You can download the free Visual C++ Express Edition here. Then just File -> New Project -> Win32 Console Application -> Finish, type up your code, then Ctrl+F5.

It could be that your console applications are closing as soon as you run them because there isn't any sort of pause at the end of execution, so it closes the window. If you "Run without debugging"(Ctrl+F5) in Visual Studio it will insert a pause for you.
 
It could be that your console applications are closing as soon as you run them because there isn't any sort of pause at the end of execution, so it closes the window. If you "Run without debugging"(Ctrl+F5) in Visual Studio it will insert a pause for you.
:iagree:What Pravit points out here is most likely to be the case. When using Bloodshed compiler, you need a pause line at the end of the main function, preceding the return statement. Simple solution would be to add
C++:
system("PAUSE");
This one, however, is Windows-specific. Instead, I prefer to prompt for user input, for example
C++:
cin.get();
 
Funny...my C++ doesn't recognize system and so gives me errors. It also doesn't recognize cin!

c:\documents and settings\ilya kipnis\my documents\visual studio 2005\projects\hello world\hello world\hello world.cpp(10) : error C2065: 'cin' : undeclared identifier
c:\documents and settings\ilya kipnis\my documents\visual studio 2005\projects\hello world\hello world\hello world.cpp(10) : error C2228: left of '.get' must have class/struct/union
type is ''unknown-type''

Is what it throws me.
 
Well, I went and DLed Bloodshed C++, and now the system("PAUSE") works. Hopefully now I can start reteaching myself this language. Thanks for all of your help so far, guys. Sorry to have to make you put up with a newbie :(
 
Back
Top