View Full Version : My C++ project
Dizzude
09-21-2003, 01:19 AM
I started learning BASIC a few years ago, but lately have found it to be not to my liking. Instead I now turn to the all-powerful C++. I understand the syntax and the basics after studying some online tutorials, but I don't know all of the libraries and their functions. Is there anyone among you who will take me in and coach me in the ways of the SEEpluhcePLUHCE?
Oh, and if you were reading this to see what my C++ project is, I'm writing a program that will allow me to make *.DWI files for DDR sims. :)
verifier
09-22-2003, 03:38 AM
well. I can start.
#include <fstream>
Fstream is used to read/write files with the STL. STL stands for Standard Template Library and is _the_ library to use when coding c++. Why? Because it exist on all (well, almost all) platforms that got C++. That means that if you only use STL in your program you can easily port it to other platforms (from linux to windows etc).
sans-hubris
09-23-2003, 04:27 PM
fstream doesn't use STL. You don't need to use STL to use fstream. Nonetheless, the STL is one of the more important libraries in C++. It shows you what's possible with C++ if people are willing to take advantage of it.
Anyway, the following is a good reference:
http://documentation.captis.com/files/c++/handbook/
Jamaican
09-23-2003, 05:40 PM
nice link, but remember he's not intermediate yet.
he'll get through though with a little scratching of the head, know what I mean.
verifier
09-24-2003, 03:32 AM
Originally posted by sans-hubris
fstream doesn't use STL. You don't need to use STL to use fstream. Nonetheless, the STL is one of the more important libraries in C++. It shows you what's possible with C++ if people are willing to take advantage of it.
Anyway, the following is a good reference:
http://documentation.captis.com/files/c++/handbook/
well. Why do you say that? std::fstream is part of STL, as all std::, right?.
ifstream in("Strfile.out");
assure(in, "Strfile.out");
// More convenient line input:
while(in.getline(buf, sz)) { // Removes \n
char* cp = buf;
while(*cp != ':')
cp++;
cp += 2; // Past ": "
cout << cp << endl; // Must still add \n
Flangazor
09-24-2003, 12:33 PM
iostreams are not part of STL, but they are part of the standard library.
SL: http://www.roguewave.com/support/docs/sourcepro/stdlibref/II.html
STL: http://www.sgi.com/tech/stl/table_of_contents.html
There is a difference that confuses many people. Or they ignore it and call the whole standard library the STL.
sans-hubris
09-24-2003, 02:22 PM
Flangazor is right.
STL is contained within the std namespace, but whatever is in the std namespace does not necessarily imply that it is a part of the STL. STL was created by SGI seperately from the ISO committee, which standardised much of the std namespace (including fstream) long before the STL was around. STL is mostly a set of containers (the exception being std::string) for people to use with whatever type they feel like.
Dizzude
09-25-2003, 12:08 AM
i appreciate your enthusiasm, but I have about *this* much understanding of what your saying. If you'd like to contact me on AIM so you can explain it that would be great, AimName=GeorgeSpaze
verifier
09-25-2003, 03:26 AM
thanks. I've learned something new today. Weee! =)
sans-hubris
09-25-2003, 04:07 AM
Originally posted by Dizzude
i appreciate your enthusiasm, but I have about *this* much understanding of what your saying. If you'd like to contact me on AIM so you can explain it that would be great, AimName=GeorgeSpaze Don't worry about it. The above was just pedantic asininity.
Dizzude
09-26-2003, 04:26 AM
Ok, maybe I need to be more specific. Can anyone tell me how to create a graphic interface? The commands were built into BASIC but in C++ I have no Idea what files to include to ge able to get:
!)Imported GIFS
2)Mouse Control
3)Key Trapping
:edit:
4)Importing *.mid, *.wav, *.mp3
5)text file input/output (iostream.h is best?)
:/edit:
I probably need other things, but these are the only ones that I can think of right now.
verifier
09-26-2003, 04:38 AM
Use mfc appwizard
Dizzude
09-26-2003, 07:03 PM
What is that, and how much is it?
sans-hubris
09-26-2003, 11:59 PM
MFC appwizard comes with VC++. VC++ can be expensive.
wxWindows (http://www.wxwindows.org/) + Dev-C++ (http://www.bloodshed.net/devcpp.html), however, is free.
Jamaican
09-27-2003, 11:21 PM
Get Dev-C++ its great!
I got both VC++ (Microsoft Visual C++) and Dev-C++ but I use Dev-C++ more often. I use Microsoft Visual Basic to program for the Microsoft platform.
MFC is Microsoft Foundation Class Library, its good if your programming for the Microsoft platform, in that case go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/mfchm.asp for every thing on the MFC and also you can do the old www.google.com search.
Dizzude
09-28-2003, 04:17 PM
Thanks for the information..i was writing in notepad and compiling in some obscure DOS app I found online...
I would really apreciate if one of you would contact me on AIM and help explain more personally how these codes function. I'm doing this project for a science fair so I need to get a move on my research; aka learning c++..
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.