When using workspace code does not function as it does in lesson

why does this code not function on workspace?
Is the lesson doing something behind the scenes?

The first example seems to be missing the input. Did you actually get a chance to input anything? If not you’ll wind up with undefined behaviour because you’re using uninitialised values.

1 Like

Thanks for the response tgrtim.
No I wasn’t given the option to input in the first example and I don’t know why. What’s making it so I’m not able to input despite the use of “cin”.

It looks like the C++ workspace is just not set up to accept any input from the terminal. I don’t think there’s any simple way around that.

I think you’d be better off reading an example of user input from a file or something along those lines if you want to continue using the cc workspaces. The behaviour should be fairly similar for getting the rest of the program set up.

Alternatively consider a different hosting site or get C++ set up on your own device.

If it’s something you think is important that’s missing then perhaps posting about it here would be worthwhile- Suggestions; Feature and Course Requests - Codecademy Forums

Ah ok, appreciate your help :slight_smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.