OT: C and C++

Ted Gould ted at gould.cx
Mon Nov 27 22:32:22 MST 2006


On Mon, 2006-11-27 at 21:46 -0700, hacktavist at cox.net 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20061127/fe95877b/attachment.pgp 


More information about the PLUG-discuss mailing list