when i try compile my code using triplex.cpp it takes me straight to visual studio for some reason. if anyone could help would be appreciated
It’s rather likely I just responded to your post on Udemy but just in case you’re someone else. Here is my reply:
You are most likely typing triplex.cpp by itself in the terminal which is exactly the same as double clicking it in File Explorer; it’s just going to open the file in the default application for that file extension, which for .cpp is Visual Studio.
To compile you need to type
cl triplex.cpp
cl is the compiler and you are giving it a file to compile. On successful compilation this would output an executable of the same name i.e. triplex.exe. Type that to execute the program.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.