change from c to c++

I ran across one of my old .c files and I am trying to figure out what the equivilant would be for c++. I used the following:


Under the .c I used scanf(&d, &MenuChoice); and scanf("%i", &dside);



Now I need to convert this to a c++ compatible statement. Can anyone give me a hand?

Thanks

greg022549
C++ is largely a superset of and is compatible with C. If you just want to compile your code, you shouldn't need to change it.

If you want to replace certain C constructs with C++, that's another matter.
The C++ input object is cin
1
2
cin >> MenuChoice;
cin >> dside;
Using scanf is won't be wrong but cin is better
http://www.cplusplus.com/doc/tutorial/basic_io/
Last edited on
Hi,
The C programming coding little bit different from C++ and easy we can change it when we making programs.
Topic archived. No new replies allowed.