OK, So i have learned C++ a little bit..
And now i started learning C and i also have learned C a little bit..
C and C++ is the almost the same except that there are some more functions and features in C++. But now when i have learned C++ a little but and started learning C it's kind of confusing and i want to write stuff from C++ to my C program and it's really all mixed up...
I mean in C i have t o include stdio.h where in C++ i have to include iostream and i don't have to write .h in C++ but i do in C... weird..
and also i output with cout << in C++ but with printf in C..
How can i do it if i keep mixing these languages... I guess if i want to learn C or C++ then i kind of have to learn both of them to understand it completely.. why did they make them so different..?
C is like basic of C++ but then C++ is very much different and i don't like that...
What do you guys think about this situation..?
Code:
// my program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World! ";
cout << "I'm a C++ program";
return 0;
}
And now i started learning C and i also have learned C a little bit..
Code:
// my program in C
#include <stdio.h>
int main()
{
printf ("Hello World!");
return 0;
}
C and C++ is the almost the same except that there are some more functions and features in C++. But now when i have learned C++ a little but and started learning C it's kind of confusing and i want to write stuff from C++ to my C program and it's really all mixed up...
I mean in C i have t o include stdio.h where in C++ i have to include iostream and i don't have to write .h in C++ but i do in C... weird..
and also i output with cout << in C++ but with printf in C..
How can i do it if i keep mixing these languages... I guess if i want to learn C or C++ then i kind of have to learn both of them to understand it completely.. why did they make them so different..?
C is like basic of C++ but then C++ is very much different and i don't like that...
What do you guys think about this situation..?