Object creation with constructor parameters

Hello.
I have some code like this:

 
Scanner myObject = new Scanner(System.in);

How this works? How do I do it in C++ with classes?
Thanks!
I would highly recommend learning the basics first...

Anyway, I guess you didn't bother to do research. Here, I typed it in the search box for you:

http://www.cplusplus.com/search.do?q=Classes

good luck.
Hello! Thanks for the reply!
I'm not a newbie... I've learn that. But if I want to do this, its simply add these parameters:
Scanner(char sysType)
on the constructor?
Oh, and another question. I have an operator that changes an member int var. There is an way to print var using the class name?
Last edited on
Topic archived. No new replies allowed.