# Anything wrong using cout in C++?



## darksteel88 (Jul 10, 2008)

I just bought a book cause I wanted to learn. In the assignments we did in class translating from C to VB (we learn VB in my comp science class), they always used print and scanf. However, this book I purchased uses cout and cin. Just wondering if it's going to make any difference. I don't believe it will, but I wanna double check.


----------



## darksteel88 (Jul 10, 2008)

Ran across another thing I am confused about. The book came with a CD to install the GNU C++, however, I can't locate an .exe to use and I don't think it works like that. I am unfamiliar with this stuff, we use Microsoft VB and it has an IDE that runs off a .exe.

Basically, I'm sitting here wondering how to open the C++ program.


----------



## dm01 (Oct 10, 2006)

Nope, cout and cin are preferred. Just remeber to #include <iostream>.

The GCC gives me a headache every time I try to install it. I have given up on it and use Dev-C++ [http://www.bloodshed.net/dev/devcpp.html] and Visual Studio. Free language-specific Express editions are available [http://www.microsoft.com/express/download/], of if you are a student in a participating post-secondary institution, you may be able to get the full-featured Visual Studio 2008 free of charge.


----------



## darksteel88 (Jul 10, 2008)

Alright, thanks for that. I was reading there were some differences, but as long as it is fine, then no worries.

I am still in HS, grade 11, taking a computer programming course (and getting the highest mark at 95% now, and also getting the highest in my other comp engineering class). I plan to continue into university though, I considering a program at a good local school that is 5 years for programming and engineering majors. That is why I am taking it on myself to learn C++ on my own time outside of school.

I am actually using Dev-C++ right now. I just don't understand what the pause and all of that is for at the bottom, and I dislike the "Press any key to continue . . ." statement at the end of the program (console application). I prefer how they did it in VB with just the flashing cursor at the end. I was using a portable version in class cause I often am finished the lesson ahead of time. I also have a copy of Visual C# from a CD one of my teachers lent me, so that should be similar enough as well. The book I am using says to include that line.

Thanks for the response, I really appreciate it. With my March break starting today, I plan to start and get through a good portion of the book, especially since I already know a good amount and just need to learn the syntax differences from VB. We're up to 1D arrays now.


----------



## dm01 (Oct 10, 2006)

Visual C# is very different from Visual C++. C# was developed as a response to Java, but being made by M$, it's not as good and costs more. C++ has been around for much longer, but M$ has injected their own little quirks into the language, essentially binding apps made with Visual Studio to the Windows OS. With Dev-C++/JCreator/Csharp, you can run them in Linux if you have the right interpreter.

Arrays are fun. They messed me up for a long time before I managed to figure them out.


----------



## darksteel88 (Jul 10, 2008)

I know that Visual C# is different, but it's the same syntax at least, or very similar. I noticed on their site that they offer downloads for C++ and VB (my copy didn't work), so that should be helpful as well.

Yea, arrays aren't too hard, but then again, I'm one of the two aces in the class.

I also will probably use Visual C++, or at least try it first. Is there any way I can edit the default so it includes the iostream code? I'm saying this particularly because I use Visual VB a lot at school and I like the graphical look of the IDE and the simplicity.

Something I'd like to make down the road, since you're in this topic, involves me loading in a file, and displaying the hexadecimal values of it, and checking the values. Basically, I want a GUI that shows the hex of the file I put in (I've seen the hex in a hex editor so I know what it should be like). Then I want to run some scripts to check if certain parts are the way they should be, ie (hex line 22 is FF). How hard would this be and what help could someone such as yourself give me? *note either VB or C++ is fine for this.


----------



## dm01 (Oct 10, 2006)

Just use an MD5 checksum.

http://sourceforge.net/projects/checksumtool/


----------



## darksteel88 (Jul 10, 2008)

Checksum will not work. I am working with a specific file type, which is not very popular (.pkm). It is the only file type I will ever use with this program. I want it as a GUI that is its own program as I plan to share it when it is done.
It needs to go something like this:

Select the file you wish to work with
Display the hex values of the file (which will remain on the page until finished)
Select the type it is (these files relate to other things and there are many subcategories)
Run a set of checks to see if certain values in the hex are acceptable values (I think I can do this myself, something like if 0x0000068 = FF then, or even convert the hex value if I have to).


----------

