<p>The comment to <a href="https://stackoverflow.com/questions/200090/how-do-you-convert-a-c-string-to-an-int#200099">this answer</a> got me wondering.  I've always thought that C was a proper subset of C++, that is, any valid C code is valid C++ code by extension.  Am I wrong about that?  Is it possible to write a valid C program that is not valid C++ code?</p>

<p>EDIT: This is really similar to, but not an exact duplicate of <a href="https://stackoverflow.com/questions/145096/is-c-actually-a-superset-of-c#145098">this question</a>.</p>

In general, yes C code is considered C++ code.
But C is not a proper subset in a strict sense.  There are a couple of exceptions.
Here are some valid things in C that are not valid in C++:
```
```
int *new;//<-- new is not a keyword in C
char *p = malloc(1024); //void * to char* without cast
```
```
There are more examples too, but you get the idea.
I previously wrote a more extensive answer in a similar question
here
.