Working with variables in C++

Hey everyone,

Happy to be here. :slight_smile:

so at the end of this session, it was mentioned how we can make our code shorter and more efficient by combining the end line command with the sum .
but mine just doesn’t work. :confused:. I kept trying and revising my codes but it’s just doesn’t work and I get nothing in the terminal. I can still get a result by writing end line on a separate line and works just fine.

you can see it in the screen-shot

I keep seeing this error. Can you please help me ? In the terminal i can only see the sum of the variables, i cannot see multiplication

C:\Triple-X GAME>cl triplex.cpp
Microsoft ® C/C++ Optimizing Compiler Version 19.28.29336 for x86
Copyright © Microsoft Corporation. All rights reserved.

triplex.cpp
triplex.cpp(13): error C2039: ‘sum’: is not a member of ‘std’
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\iostream(19): note: see declaration of ‘std’
triplex.cpp(14): error C2039: ‘product’: is not a member of ‘std’
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\iostream(19): note: see declaration of ‘std’

C:\Triple-X GAME>

Privacy & Terms