Author Topic: Help with the first four lines  (Read 2554 times)

nikinikin

  • Guest
Help with the first four lines
« on: March 07, 2011, 09:18:53 pm »
In our school we study C++ using this program. I installed it at home in order to be able to practise, but in the school, whenever I start a new project, the first four lines are always already written. However, when I installed the program on my home PC and decided to try it, it seems that I have to write all the lines which are given in the beginning in each project in school. Could you tell me how to fix this and, if you can't, could you tell me the first four lines?
I enclose an example of the tasks which we currently do. However, I've only written the lines after number 4, because, as I have already said, I thought they would be given like they are in school.
5 line: int a,b;
6 line: cout<<"a=";
7 line: cin>>a;
8 line: cout<<"b=";
9 line: cin>>b;

The task was to declare two variable a,b from the int type and to insert values for them.

Thank you in advance.  :)

UPDATE: I now know the first four lines (I saw them in the course book :D ):
//programname.cpp
#include<iostream.h>
int main()
{
(now are the lines I have already written above)
}

Could you now explain me why are these lines in the beginning of each task and how I can make them appear always without having to write them every time?
« Last Edit: March 07, 2011, 09:47:59 pm by nikinikin »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Help with the first four lines
« Reply #1 on: March 08, 2011, 01:29:37 am »
Settings -> Editor -> Default Code

There you can place the four lines you mention  :P

It seems your school did it to keep programming concepts basic. But hey they should at least explain what those 4 lines mean  :D