Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 12-08-2007, 07:19 AM   #1
Beta Member
Join Date: Dec 2007
Posts: 3
Default C++ Commands

Hey everyone, I'm getting interested in programming and I know that C is one of the better languages used in programming. If anyone would be willing to, say type out a list of common C++ commands and what they do, I think this thread would be helpful to many people even just for refreshing them-selves on some of the commands.

acro is offline   Reply With Quote
Old 12-08-2007, 02:10 PM   #2
Fully Optimized
Š88's Avatar
Join Date: May 2005
Posts: 4,775
Send a message via MSN to Š88
Default Re: C++ Commands

There aren't too many differences between C and C++. It's just there's no strings in C like in C++. For a string in C you must create an a character array with a null terminating character at the end '\0'.

Also there are no STL functions associated with C, hence why C++ is a little easier to learn.

printf in C is equal to cout in C++

scanf in C is equal to cin in C++ (well there are other ways for user input too in C)

I would recommend anyone to learn C if even they decide to learn C++ first because you get a much better understanding of memory allocation using the C language. C++ tends to do a lot of the work for you when it comes to memory allocation.

sorry that i didn't list out your commands, mostly because there are tons of them and some would take a page of writing to explain. I think it's easier to just look up a C/C++ tutorial. Actually my advice for getting a quick rundown of the C language is to pick up a book called "The C Programming Language" by Kernighan and Ritchie. I think it is by far the best book out there for this (C language that is).

Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lösung!
Š88 is offline   Reply With Quote
Old 12-08-2007, 05:01 PM   #3
In Runtime
AllThingsSacred's Avatar
Join Date: Aug 2007
Posts: 302
Default Re: C++ Commands


The above link may help. I have found it to be extremely useful when I was learning the language.

As for commands, there are not commands as such, merely keywords which you use.

For example, here is a simple "Hello World!" program in C++.

#include <iostream>

int main (int argc, char* argv[])

std::cout<<"Hello World!\n"<<std::endl;

return (0);
I strongly recommend getting a book, or at least looking at some online tutorials.

C++ does actually do a little bit more memory management for you, but you must still do most of it unlike in languages like Java.

C++ is a very wide ranging language which has all manner of add-ons and external libraries you can use, but it can also get hellishly complicated later on. It may take you years to master it [as I have not, I must add; I am far from being an expert but am well versed in the basics], but good luck to you.
Patrick Moore
Born London, Live London, Die London
As a Londoner, I exercise my God given Right to do as I please
AllThingsSacred is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 03:28 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0