C and C++ are quite a lot alike. So you'll find you know most parts of the C language if you know C++. There are a few incompatibilities though:
First of all, anything related to classes, namespaces, inheritance etc. cannot be used in C. So you'll need to get into the habit of having a lot of global functions operating on structs and other primitive data types. It might also be a good idea to come up with a naming convention for these functions, since you might lose track of what a function does (although comments will help here).
Second of all, in C the keyword struct must be repeated each and every time you use a struct type. For example take this C++ code:
1 2 3 4 5 6 7 8
|
struct somestruct
{
int a, b;
};
//Somewhere in a function
somestruct value;
value.a = 2;
|
Becomes this in C:
1 2 3 4 5 6 7 8
|
struct somestruct
{
int a,b;
};
//Somewhere in a function
struct somestruct value;
value.a = 2;
|
Since it's annoying to repeat struct that much, C programmers usually tend to use a "typedef struct" to solve this:
1 2 3 4 5 6 7 8
|
typedef struct somestruct
{
int a, b;
} SomeStruct;
//Somewhere in a function
SomeStruct value;
value.a = 2;
|
Third of all, C's standard library is a lot smaller than C++'s. You can take a look at the reference on this site. Go to the "C library" part of it. That's all you have in C. It takes a while to get used to not being able to use any form of standard container.
But most of the time you'll be able to understand C quite well. The primitive data types are the same, functions, pointers, arrays are all the same. You should be able to understand C well enough.
I don't know if with C you mean the C99 standard though. If not, there's one last thing to consider, the placing of variables. In C++ you can declare a variable nearly everywhere:
1 2 3 4
|
int someint = 5; //I need an int here
somefunction(4 + someint);
int anotherint = 8; //And another one here
somefunction(someint-anotherint);
|
Before the C99 standard this is illegal in C. Instead, all variables will have to be declared at the start of a block, meaning code looks more like this:
1 2 3 4 5
|
int someint = 5; //I need an int
int anotherint = 8; //I'll need this later on
//Now all variables are declared, write the actual code
somefunction(4 + someint);
somefunction(someint - anotherint);
|
There are a few annoying little incompatibilities between the languages. Like how C performs an implicit cast from void* whereas C++ doesn't. But most of the time, you should be fine when you know C++.