Hello I just registered. I am very new begginer and I'd like to learn scripting starting from the scratch. What I want to ask you is as following, what should I write to get the second text right below the 1st text. So text below text provided by two same commands (using int main). Hope you understand what I mean.
As well I would appreciate if anyone could share a link to any C++ tutorial/forum section for begginers from where I could get some basic information.
1 2 3 4 5 6 7 8 9 10
1st command:
int main()
{
std::cout << "Hello World! This is my first project.\n";
}
2nd command:
int main()
{
std::cout << "Welcome begginer.\n";
}.
A few areas as a single program to start playing around:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include <string>
int main()
{
std::string name{"World"};
std::cout << "Hello " << name << " This is my first project.\n";
std::cout << "Please enter your name: ";
std::cin >> name;
std::cout << "Hello " << name << "! This is my first project.\n";
name = "beginner";
std::cout << "Welcome " << name << ".\n";
}
Hello World This is my first project.
Please enter your name: Rob
Hello Rob! This is my first project.
Welcome beginner.
Program ended with exit code: 0
@seeplus I am running/writing the scripts with Microsoft Visual Studio 2022 on my Windows 10 if that is what you are asking
@Handy Andy It is supposed to be 1 program only I guess (to run with Local windows debugger). I have no experience with coding or Visual studio - it is a blank page for me, I was just recommended to try writing/learning c++ code, and it might become interesting.
Thanks again for your instructions/tutorials @all, will be happy to work when I will have time to do so. Cheers and happy coding.
@seeplus I am running/writing the scripts with Microsoft Visual Studio 2022 on my Windows 10 if that is what you are asking
I think there is some confusion here - between a script and a program source code.
A program is not usually referred to as a script. A "script" is code written in a scripting language that is used to control another software application. So a C++ program is not called a script, but batch control would be - hence my earlier reply.
In this case, againtry's post above is more like what you want.