I\'ve been learning C at Varsity for just shy of 2months now, and next year we\'ll be moving on to C++.
Are there any habits I should get into with my C programmin
C++ programs are totally different. you had better spend your time learning C++ than working on C elements trying to improve them for C++.
For example even the simple 'Hello World' program, differs considerably:
C:
#include
int main(void)
{
printf("Hello, world!\n");
return 0;
}
C++:
#include
int main()
{
std::cout << "Hello, world!\n";
}
(Examples from here).
As 'printf' is a function whereas 'cout' is not a function but an instance of an ostream class.
Further reading: iostream.