Re: OT: C and C++

Top Page
Attachments:
Message as email
+ (text/plain)
+ signature.asc (application/pgp-signature)
+ (text/plain)
Delete this message
Reply to this message
Author: Ted Gould
Date:  
To: Main PLUG discussion list
Subject: Re: OT: C and C++
On Mon, 2006-11-27 at 21:46 -0700, wrote:
> i know this is off topic but, i was wondering if anyone has a good example
> differnce between C and C++, i am a total n00b, when i comes to
> development and or programming, so i am still a little in the dark.


Basically C++ adds extra syntax extensions on to C. It's an
evolutionary thing. So, basically anything you can do in C is valid C
++, but not ideal. C++ adds ways to do things that are easier.

C:

char bigstring[7];
sprintf(bigstring, "%s%s", "foo", "bar");

C++:

std::string bigstring;
bigstring = "foo";
bigstring += "bar";

        --Ted


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss