Tutorials on c++?

  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

I have just gotten visual c++ 6.0 and i have no clue how to program in c++ in fact i know nothing but html :/ Please send me a link to a c++ guide Thank you!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

For 1, I'd recommend another compiler for C++.

VisualC++ 6 is fairly broken and ignores the standard. Hell it came out BEFORE the C++ standard.

I'd recommend using MinGW, or if you need an IDE (editor and compiler built into 1 application) use DevShed's C++ IDE or even VisualC++ .NET 2003

Also, HTML has no relavence to programming. Programming is when you create code to do something, HTML is just sets of tags to be interpreted by a Rendering Engine within a browser.
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

Are those compilers free? if so please send me a link :)
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
Are those compilers free? if so please send me a link :)
MinGW is a free compiler. Dev-C++ uses MinGW to create an IDE.

MinGW can be found at http://www.mingw.org however, a person at http://www.nuwen.net created a much better package for MinGW. If you use MinGW, it's command line compiling.

DevShed's C++ IDE would probably be better for a new person, it uses MinGW but in a fine and friendly Interface. You press play and it compiles. Link: http://www.bloodshed.net/devcpp.html
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

Heh well a long time ago i purchased a idiots guide to c++ the compiler was a dos program and it did not work correctly so i went out and got visual C++ the stuff in the book was like another language to visual c++ is that what you meant in your first reply? that may not have made a lot of sense... if that is the case i can use the book as a guide lol...
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
Heh well a long time ago i purchased a idiots guide to c++ the compiler was a dos program and it did not work correctly so i went out and got visual C++ the stuff in the book was like another language to visual c++ is that what you meant in your first reply? that may not have made a lot of sense... if that is the case i can use the book as a guide lol...
VisualC++ is a C++ IDE. It has a compiler in it and an editor.

The C++ book probably only taught you the C++ language, where as VisualC++ trys to focus more on Windows GUI programming using the API, alt and MFC.

I'd work on learning the C++ language first before using GUIs.

and VC++ 6 is horrible at the standard, so I wouldn't use it. That or you can find the package that combines the Intel compiler into VC++ 6. Then it becomes a decent compiler but that may be a bit hard for you since you're new.
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

im confused heh... You have a link to a guide that will teach me? or do you sugest using the book i have now? BTW Thanks for the links and help
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
im confused heh... You have a link to a guide that will teach me? or do you sugest using the book i have now? BTW Thanks for the links and help
Buy a book, learn C++ before any GUI crap.

http://www.nuwen.net click C++ then scroll to almost the bottom and it gives some EXCELLANT book suggestions.

Just NEVER EVER EVER BUY ANYTHING BY HERBET SCHILDT
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

The book i have says it uses a gnu compiler. So does that mean the book i have will do fine with the new compiler you suggested?
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
The book i have says it uses a gnu compiler. So does that mean the book i have will do fine with the new compiler you suggested?
If the book was made several years ago, then it won't be a good book since the C++ standard just came out like 4 years ago and books just NOW have been getting more standards complient.

Also, idiots guide to anything suck, those are some horrible books. Atleast in programming/scripting they are horrible.
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

its a dummies guide probobly just as bad heh. i have no clue how old the book is i have only had it about a year does not mean its new :/
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

I was wondering what c++ is capable of making can you please sumbit a list of programs c++ can make Thank you :) i need to know what c++ does before i learn it :/ im really looking to program games.. and photo editing programs and such thank you :)
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

ok i have installed dev c++ now i have no clue what kind of project im going to do... heh...........?
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
I was wondering what c++ is capable of making can you please sumbit a list of programs c++ can make Thank you :) i need to know what c++ does before i learn it :/ im really looking to program games.. and photo editing programs and such thank you :)
C++ is a general purpose language. You can make anything with it, except something like a bootstrap.
lostsoul wrote:
ok i have installed dev c++ now i have no clue what kind of project im going to do... heh...........?
Uh.... did you buy any books or anything? The project names should speak for themselves.....
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

Hmm i put a conversion code and compile it i open the msdos .cpp file and i type in number and it automatically closes dos... its suposed to convert the code heh
//
// Conversion - convert temperature from Celsius
// degree units into Fahrenheit degree
// units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <stdio.h>
#include <iostream.h>
int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in Celsius
int nCelsius;
cout << "Enter the temperature in Celsius:";
cin >> nCelsius;

// calculate conversion factor for Celsius
// to Fahrenheit
int nFactor;
nFactor = 212 - 32;

// use conversion factor to convert Celsius
// into Fahrenheit values
int nFahrenheit;
nFahrenheit = nFactor * nCelsius/100 + 32;

// output the results
cout << "Fahrenheit value is:";
cout << nFahrenheit;

return 0;
}
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

Btw how hard is c++ to learn :/ lol for a 16 year old that is.
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
Hmm i put a conversion code and compile it i open the msdos .cpp file and i type in number and it automatically closes dos... its suposed to convert the code heh

Time to learn C++.

For one, the Window should close. You are NOT supposed to just double click it. It is a program run from command prompt.

To let you know:
Code: [ Select ]
#include <stdio.h> //Deprecate header file, use #include <cstdio>
#include <iostream.h> // Deprecate header file, use #include <iostream>
//Since you should use #include <iostream>, you are required to put the using namespaces directive
//afterwards so it would be 'using namespace sdt;' under the #includes

int main(int nNumberofArgs, char* pszArgs[])//The arguements arn't required when you arn't accepting arguments in the program
{
  
  int nCelsius;
  cout << "Enter the temperature in Celsius:"; //no where in the program do you use << endl;. This means
    //the buffer never gets flushed. You should atleast use << endl; when you want a line to end
  cin >> nCelsius; //fine for now, but you'll want to move to getline() eventually

  int nFactor;
  nFactor = 212 - 32; // fine but could be combined into 1 statement.

  int nFahrenheit;
  nFahrenheit = nFactor * nCelsius/100 + 32;

  cout << "Fahrenheit value is:";
  cout << nFahrenheit;

  return 0; // return 0 is NOT required and shouldn't be used in C++ for the funciton main().
    //main() will ALWAYS return an int and 0, so you can elide return 0;
}
  1. #include <stdio.h> //Deprecate header file, use #include <cstdio>
  2. #include <iostream.h> // Deprecate header file, use #include <iostream>
  3. //Since you should use #include <iostream>, you are required to put the using namespaces directive
  4. //afterwards so it would be 'using namespace sdt;' under the #includes
  5. int main(int nNumberofArgs, char* pszArgs[])//The arguements arn't required when you arn't accepting arguments in the program
  6. {
  7.   
  8.   int nCelsius;
  9.   cout << "Enter the temperature in Celsius:"; //no where in the program do you use << endl;. This means
  10.     //the buffer never gets flushed. You should atleast use << endl; when you want a line to end
  11.   cin >> nCelsius; //fine for now, but you'll want to move to getline() eventually
  12.   int nFactor;
  13.   nFactor = 212 - 32; // fine but could be combined into 1 statement.
  14.   int nFahrenheit;
  15.   nFahrenheit = nFactor * nCelsius/100 + 32;
  16.   cout << "Fahrenheit value is:";
  17.   cout << nFahrenheit;
  18.   return 0; // return 0 is NOT required and shouldn't be used in C++ for the funciton main().
  19.     //main() will ALWAYS return an int and 0, so you can elide return 0;
  20. }



Revised version of your code:
Code: [ Select ]
#include <cstdio>
#include <iostream>
using namespace std;

int main()
{
  
  int nCelsius;
  cout << "Enter the temperature in Celsius: ";
  cin >> nCelsius;

  int nFactor = 212 - 32;
  int nFahrenheit = nFactor * nCelsius/100 + 32;

  cout << "Fahrenheit value is: " << nFahrenheit << endl;
    system("PAUSE");
}
  1. #include <cstdio>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.   
  7.   int nCelsius;
  8.   cout << "Enter the temperature in Celsius: ";
  9.   cin >> nCelsius;
  10.   int nFactor = 212 - 32;
  11.   int nFahrenheit = nFactor * nCelsius/100 + 32;
  12.   cout << "Fahrenheit value is: " << nFahrenheit << endl;
  13.     system("PAUSE");
  14. }


See how much cleaner that is? Also, if you don't want to transverse the directories in command prompt to run your program from command prompt, #include <cstdio> in your program, then use system("PAUSE"); in your code when you want the program to stop so you can view the output.

I would recommend using a new book and maybe finding a new tutorial online, which is usually hard to find.

lostsoul wrote:
Btw how hard is c++ to learn :/ lol for a 16 year old that is.

C++ is an easy language. Once you learn the syntax, it isn't difficult at all. Some code may look complex as hell, but it usually isn't and once you get a grasp of things, you can understand it.

C++ is actually one of the easier languages.
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

ok msdos is something i really never cared to experiment with so im in msdos prompt how do i run the exe from there? D:\Program Files\c++ is the directory my file is stored in. but dos prompt says c:\WINDOWS> lol hope i dont sound stupid asking that :/
  • Kasracer
  • Banned
  • Banned
  • Kasracer
  • Posts: 26
  • Loc: Maryland

Post 3+ Months Ago

lostsoul wrote:
ok msdos is something i really never cared to experiment with so im in msdos prompt how do i run the exe from there? D:\Program Files\c++ is the directory my file is stored in. but dos prompt says c:\WINDOWS> lol hope i dont sound stupid asking that :/
You could do like I said and just use system("PAUSE"); at the point in your code when you want it to pause.

Otherwise, type this
Code: [ Select ]
cd\
chdir /d d:
cd "Program Files"
cd c++
  1. cd\
  2. chdir /d d:
  3. cd "Program Files"
  4. cd c++

Then just find the executable's name, type it in and hit enter.
  • lostsoul
  • Beginner
  • Beginner
  • lostsoul
  • Posts: 39
  • Loc: Ocala, FL

Post 3+ Months Ago

Ok thanks i got it :)

Post Information

  • Total Posts in this topic: 20 posts
  • Users browsing this forum: No registered users and 75 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.