Section 2 Bulls and Cows question

There is a part where you have to add main.cpp. I created a text document and named it Main, I then opened it in visual studio and saved it as a .cpp. In my folder it showed it as C++ source in the folder just like the lecture shows however when you looked at the project opened it did not show under source files. Any ideas why. ( I went back and done it how the lecture showed )

Why didn’t you just create it in Visual Studio and put the content of the text document is Visual Studio?

try saving text document as main.cpp but as All Files type not text document in the save dialog box

You should be doing all your coding in Visual Studio though. Why did you do a text document first?

Because I wasn’t sure how to do it in visual studio. Was trying to do it myself before continuing the lecture. I know how to do it through visual studio now. I was just unsure why what I did the first time didn’t work.

That’s how I saved the text document. Then I opened it in visual studio and changed it to main.cpp. in the folder it showed correctly as the source file. But when I opened the project in visual studio it wasn’t showing up.

Did you add it to your project instead of just opening it?

I did not. Now that I think about it. The original file was created in the project folder and saved but I did not save it to the project. I shall go play now.

Hope that was the problem and it works for you.

Thank you.