C++ Visual studio_ how to use
Hello, In this post, we will see how to use Visual studio with some pictures.
This is not a writing for 'what is c++' or 'how to study c++'.
It's just knowing basic tool for using visual studio like 'how to make new project', 'where can we find our project' and 'how to add existing source files'.
And I posted some mistakes people usually make.
Surprisingly, there are common trivial mistakes I have seen.
I think person who starts learning c++ 'will have or had' that problem.
Ok. let's see first how to download visual studio.
go to https://www.visualstudio.com/, click the button download and download visual studio! visual studio community is free.
It is on your mind what version you want to download. I'm using visual studio 2015 but 2013 also fine.
It is not a hard work to download yourself.
If you have some problems downloading visual studio, please comments in this post.
Maybe that will not be hard to be solved.
After downloaded visual studio, please open it.
you can see this display when open visual studio.
In the file tab which is located in left-up side in display, we can create, open or save our projects. Needless to say, saving is important. Make a habit saving often.
If you want to make new project first click the file button, new button then project button.
I'm sorry for the low resolution of images. I will find other way capturing display.
Opening existing project is similar with this. just click open button in file tab.
Let's continue to make new project in visual studio.
Hmm..... It's not good to look at captured images. I don't know why it is.
Although I want to say please read text and see pictures to follow...I'm not sure picture is useful.
If you clicked new project you can see new window on your display.
To use c++, you should click Visual c++ at left side. Then, click Win32 Console Application. Name on it, project name, in Name tab. It is better to decide name considering 'what is project for?' so I will name this project 'test'.
click ok button, and there will be new window like this.
click Next, check box on Empty project and click button 'finish'.
In the course we will take, Header files folder and Source files folder will be used.
Usually in Header file folder, we add header files like 'examples.h' and in Source file we add c++ files like 'examples.cpp'
Difference of cpp file with header file will be discussed in other post.
To learn c++ we should make new c++ file that is source file. So Please position the mouse cursor on Source Files folder and click right mouse button. click Add tab, and New item.
If you have already source file you want to add in this project, you should click existing Item and load file.
But you don't need to load existing file you made today whenever you want to practice c++ using today's source file. Instead, you can open 'test project' we made today. In that project, there are source file you saved. That means you can use today's source file by opening project(today's project).
Click c++ Files(.cpp) because we will add in Source Files folder. If was in Header Files folder, we would click Header File(.h).
Name on cpp file like project. I will use Source.cpp that is a basic name.
Oh, you can see c++ file location below name blank. And it was also seen when you made new project.
Usually project you made is located at Project folders in Visualstudio 2015(or 2013) folder in Documents folders.
When you want to open existing project you can click 'open button' in 'file tab' as you saw at first picture in this post, or you can just double click 'ProjectName.sln'(test.sln) at location above, written in blue text.
Anyway after adding source file in Source Files folder, you are ready to learn c++.
Let's run a test if project was made successfully.
shit. what a pool image it is! In this post you don't have to look codes so it is better to just see project's successful result.
If you want to see code, here
#include <iostream>
using namespace std;
int main()
{
cout << "Blog posting" << endl;
return 0;
}
This code is to see "Blog posting" string and it works well. I wish you can see Blog posting on console in picture.
This is end of creating new project and source file. now you are ready to be a programmer. I will recommend you try to open existing project or source file by yourself. It is not a hard work.
Maybe there are someones who have trouble with console not being seen.
you can solve it by adding code system("pause");
#include <iostream>
using namespace std;
int main()
{
cout << "Blog posting" << endl;
system("pause");
return 0;
}
It is happened because you may made project not 'Win32 console Application' but 'Empty Project'. You can see third picture in this post to understand what i'm saying.
It is not a fault making Empty project, we also checked box on empty project after choosing win32 console application.
But as we will use console application, I prefer to make project win32 console application.
A lot of my friends have asked me why they couldn't see console. I hope you don't spend much time concerning this problem.
plus if you are trying to study c, not c++ you will use #include <stdio.h> rather than #include <iostream>
and there a common mistake I and my friends made. It is <stdio.h> not an <studio.h>
we spend much time finding where error is. people who start programming first time is likely to misread stdio. Knowing stdio meaning will help you not to make a mistake. stdio means 'standard input, output'.
Until we saw how to make project and source file, and some trivial problems that would make beginner crazy.
I hope you feel familiar to visual studio soon, and I finished this posting now.
It is really basic work to get ready for learning c++. Try to use or see other menu in visual studio, so you can use someday. Thank you and Hello world!
This is not a writing for 'what is c++' or 'how to study c++'.
It's just knowing basic tool for using visual studio like 'how to make new project', 'where can we find our project' and 'how to add existing source files'.
And I posted some mistakes people usually make.
Surprisingly, there are common trivial mistakes I have seen.
I think person who starts learning c++ 'will have or had' that problem.
Ok. let's see first how to download visual studio.
go to https://www.visualstudio.com/, click the button download and download visual studio! visual studio community is free.
It is on your mind what version you want to download. I'm using visual studio 2015 but 2013 also fine.
It is not a hard work to download yourself.
If you have some problems downloading visual studio, please comments in this post.
Maybe that will not be hard to be solved.
After downloaded visual studio, please open it.
you can see this display when open visual studio.
In the file tab which is located in left-up side in display, we can create, open or save our projects. Needless to say, saving is important. Make a habit saving often.
If you want to make new project first click the file button, new button then project button.
I'm sorry for the low resolution of images. I will find other way capturing display.
Opening existing project is similar with this. just click open button in file tab.
Let's continue to make new project in visual studio.
Hmm..... It's not good to look at captured images. I don't know why it is.
Although I want to say please read text and see pictures to follow...I'm not sure picture is useful.
If you clicked new project you can see new window on your display.
To use c++, you should click Visual c++ at left side. Then, click Win32 Console Application. Name on it, project name, in Name tab. It is better to decide name considering 'what is project for?' so I will name this project 'test'.
click ok button, and there will be new window like this.
click Next, check box on Empty project and click button 'finish'.
only work you should care is just checking box on Empty project and deciding project's name maybe? Always giving name to something is not an easy work!!
Almost done. Here's the project I made. You can see project name in right side 'test', and there are many sub folder below project name. maybe you already guessed project includes source file, header file and other file below project name.In the course we will take, Header files folder and Source files folder will be used.
Usually in Header file folder, we add header files like 'examples.h' and in Source file we add c++ files like 'examples.cpp'
Difference of cpp file with header file will be discussed in other post.
To learn c++ we should make new c++ file that is source file. So Please position the mouse cursor on Source Files folder and click right mouse button. click Add tab, and New item.
If you have already source file you want to add in this project, you should click existing Item and load file.
But you don't need to load existing file you made today whenever you want to practice c++ using today's source file. Instead, you can open 'test project' we made today. In that project, there are source file you saved. That means you can use today's source file by opening project(today's project).
Click c++ Files(.cpp) because we will add in Source Files folder. If was in Header Files folder, we would click Header File(.h).
Name on cpp file like project. I will use Source.cpp that is a basic name.
Oh, you can see c++ file location below name blank. And it was also seen when you made new project.
Usually project you made is located at Project folders in Visualstudio 2015(or 2013) folder in Documents folders.
When you want to open existing project you can click 'open button' in 'file tab' as you saw at first picture in this post, or you can just double click 'ProjectName.sln'(test.sln) at location above, written in blue text.
Anyway after adding source file in Source Files folder, you are ready to learn c++.
Let's run a test if project was made successfully.
shit. what a pool image it is! In this post you don't have to look codes so it is better to just see project's successful result.
If you want to see code, here
#include <iostream>
using namespace std;
int main()
{
cout << "Blog posting" << endl;
return 0;
}
This code is to see "Blog posting" string and it works well. I wish you can see Blog posting on console in picture.
This is end of creating new project and source file. now you are ready to be a programmer. I will recommend you try to open existing project or source file by yourself. It is not a hard work.
Maybe there are someones who have trouble with console not being seen.
you can solve it by adding code system("pause");
#include <iostream>
using namespace std;
int main()
{
cout << "Blog posting" << endl;
system("pause");
return 0;
}
It is happened because you may made project not 'Win32 console Application' but 'Empty Project'. You can see third picture in this post to understand what i'm saying.
It is not a fault making Empty project, we also checked box on empty project after choosing win32 console application.
But as we will use console application, I prefer to make project win32 console application.
A lot of my friends have asked me why they couldn't see console. I hope you don't spend much time concerning this problem.
plus if you are trying to study c, not c++ you will use #include <stdio.h> rather than #include <iostream>
and there a common mistake I and my friends made. It is <stdio.h> not an <studio.h>
we spend much time finding where error is. people who start programming first time is likely to misread stdio. Knowing stdio meaning will help you not to make a mistake. stdio means 'standard input, output'.
Until we saw how to make project and source file, and some trivial problems that would make beginner crazy.
I hope you feel familiar to visual studio soon, and I finished this posting now.
It is really basic work to get ready for learning c++. Try to use or see other menu in visual studio, so you can use someday. Thank you and Hello world!









Comments
Post a Comment