I want to learn C++ but....

Status
Not open for further replies.
Shuffle said:
I haven't seen much of a difference between C and C++, personally..
You will never notice a difference between bad C code and bad C++ code- they are very similar. However, if you compare good C code and good C++ code, then you will notice a lot of difference.

C++ introduced object-oriented programming into the language. You won't find classes or anything of the sort in C.

Try looking here for help on C++: http://www.cplusplus.com/doc/#tutorial
That's a great tutorial, and although I never use C++, it was a great help.
 
Oogaland said:
RyanHedge said:
No offence, but I tryed using the code in the book and the compile itself siad it was to old to use!!!

(Let's not argue though)

0_0 It could be that the book was trying to teach you K&R C, but no-one (except UNIX-programmer-types) has used that for... a long time: since the mid-eighties, I think. Even then, however, I find it odd (but I don't doubt your veracity!) that a compiler should complain when you feed it K&R C. I'm curious now. What code didn't it like?

Lets see here I'll type up what the first basic code in the book was... Whate else hello world!

//myfirst.cpp
//For the none c junkies this is a simple program that should say, come up //and C++ me sometime.
// Yes I put this in myself Ryan.

#include <iostream>
using namespace std;
int main()
{
cout << "Come up C++ me some time.";
cout << "\n";
return 0;
}
 
I guess for readability- It prints out a multiline statement, so it probably should be more then one print on a line.

Hmm, that did not make sense...
 
That's the formatting in this book.

I think this book seems to have some quakes in it maybe I should look into other...

Yes I'm reading the sources you guys gave me. ^^
 
If it's just the syntax that you're confused about, look into PHP (see also: XAMPP). PHP has a syntax very similar to C++, although it hides everything about normal, compiled languages from you..
 
Kill me it's a double post....

Well the coding works fine and I made the program but... Who give a maple!!! It just says what I siad it would say... Come up and C++ me sometime.

//myfirst.cpp
//For the none c junkies this is a simple program that should say, come up
//and C++ me sometime.
// Yes I put this in myself Ryan.
#include <cstdlib>
#include <iostream>

using namespace std;
int main()
{
cout << "Come up C++ me some time.";
cout << "\n";
system("pause");
return 0;
}

Ahem for the others around here just looking and learning... System("puase"); is just that it puases your dos prompt until you press something on your keybaord to shut the program down it's very basic and it's nothing that you couldn't type. This is what you call a Hello world program it test the waters of anyone who wants to program in a languge. You would see this in every PC programming laungange there is so make sure to test it every new luangage you do to make sure you understand the basic coding. Oh, the book seems to be okay thanks everyone. ^^


T_T: I tried opening the SRB2 source on my computer... It's crashed... What would be good system Reqirments for tinkering with the source?
 
RyanHedge said:
T_T: I tried opening the SRB2 source on my computer... It's crashed... What would be good system Reqirments for tinkering with the source?
Anything that can run a text editor. :P Just open the individual files in the text editor of your choice and run make when you want to build an executable.
 
C++ is conmpatible down to anything such as DOS' EDIT command.

I think that you're thinking about stuff such as indentation, but if I remember correctly, C++ ignores all indentation. There was this really mashed-up code that Alam (or Logan, I can't remember) wrote that did something, but you couldn't even tell what it did.

An example of where indentation isn't needed in most languages today would be something like this.
Try running this. (It's Perl, not C++, but you get the idea):
Code:
length q bless glob and print chr oct ord q mkdir m and print chr ord q xor x and print chr ord q q q and print chr ord uc q map m and print chr ord q qw q and print chr ord q each le and print chr ord q my alarm and print chr oct oct ord uc qw q for q
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top