The type of C++ you are learning is strongly discouraged.

    * You are not learning STANDARD C++. Its the Turbo C++, if you
      compile on standard C++ compiler like gcc, your program wont even
      compile.
    * Use of goto statements is strongly discouraged. Use while loops
      instead.
    * clrscr() and getch() are not a part of standard C++. Even cout
      comes under std namespace.
    * Also in standard C++, header files wont have ".h" at the end.


You are still a beginner, so it would be easy for you to change. Pls 
shift to some nice book. The book you are following now is not teaching 
you standard C++.





Olufowobi Lawal wrote:
>  
>
> First visit the groups' page,
>
> http://tech.groups.yahoo.com/group/c-prog/files/ 
> <http://tech.groups.yahoo.com/group/c-prog/files/> and read the links 
> there and
>
> then get read of OLD COMPILERS, like you are obviously using. You 
> could get MSVC or get this http://www.bloodshed.net/download.html 
> <http://www.bloodshed.net/download.html> .
>
> Lawal.O
>
> ________________________________
> From: Sarthak B. <coolsb_1...@yahoo.co.in 
> <mailto:coolsb_1995%40yahoo.co.in>>
> To: c-prog@yahoogroups.com <mailto:c-prog%40yahoogroups.com>
> Sent: Thu, January 21, 2010 3:36:30 PM
> Subject: [c-prog] Help! I am new on C++
>
> I am new to C++. Can somebody help me to learn different features of 
> C++, like a good tutorial or something. the best program i can make 
> yet is this:
>
> #include<iostream. h>
> #include<conio. h>
> void main()
> {
> clrscr();
> cout<<" Welcome to CBot- Your utlimate guide to doing any calcutaion 
> of two numbers! "<< " \n Please click enter to continue ";
> int a,b,c,min,max, cal,com,ent;
> getch();
> start:
> clrscr();
> cout<<" Please enter the first number ";
> cin>> a;
> clrscr();
> cout<<" Please enter the second number ";
> cin>> b;
> clrscr();
> cout<<" You entered "<< a<< " and " <<b;
> cout<<" \n Please confirm these numbers.Press 1 if the numbers are 
> right and press 2 if the numbers are wrong and you wish to re-enter 
> the numbers ";
> cin>>com;
> if (com==1)
> {
> cout<<" You confirmed the numbers. please click enter to see the 
> calculation options ";
> getch();
> clrscr();
> cout<<" ADD-1 ";
> cout<<"\n SUBTRACT-2 ";
> cout<<"\n DIVIDE-3 ";
> cout<<"\n MULTIPLY-4 ";
> cout<<"\n MAXIMUM-5 ";
> cout<<"\n MINIMUM-6 ";
> cout<<"\n Please enter the number corresponsing to the calculation you 
> would like to do ";
> cin>>cal;
> if ( cal==1)
> {
> cout<<" The sum of "<< a<<" and "<<b<<" is "<<a+b;
> }
> if ( cal==2)
> {
> cout<<" The remainder of "<< a<<" and "<<b<<" is "<<a-b;
> }
> if ( cal==3)
> {
> cout<<" The divident of "<< a<<" and "<<b<<" is "<<a/b;
> }
> if ( cal==4)
> {
> cout<<" The product of "<< a<<" and "<<b<<" is "<<a*b;
> }
> if ( cal==6)
> {
> min=a;
> if (min>b)
> {
> min=b;
> }
> cout<<" the smaller number between "<<a<<" and "<<b<<" is "<< min;
>
> }
> if ( cal==5)
> {
> max=a;
> if (max<b)
> {
> max=b;
> }
> cout<<" the bigger number between "<<a<<" and "<<b<<" is "<< max;
>
> }
> }
> if (com==2)
> {
> cout<<" Please press enter to try again ";
> getch();
> goto start;
> }
> cout<<endl<< "\n Hope you enjoyed the program. Press 1 to do another 
> calculation. Press 2 to exit the program ";
> cin>>ent;
> if (ent==1)
> {
> goto start;
> }
> if (ent==2)
> {
> clrscr();
> cout<<" Press enter to end the program ";
> getch();
> }
> }
>
> Guys, please make me aware of more things on C++. THanks
> This Mail Was Send 2 U By: coolsb_1995@ yahoo.co. in
>
> --- On Thu, 21/1/10, John <jm5...@gmail. com> wrote:
>
> From: John <jm5...@gmail. com>
> Subject: [c-prog] Re: Problem with dynamic memory allocation
> To: c-p...@yahoogroups. com
> Date: Thursday, 21 January, 2010, 6:47 PM
>
> --- In c-p...@yahoogroups. com, shamir shakir <dewswo...@. ..> wrote:
>
> >
>
> > So, is there any function to run-time checking here that I can use?
>
> There isn't anything in the C Standard - I suspect C++ is the same, 
> although I'm not a C++ programmer.
>
> Try checking your compiler/IDE documentation - there might be an 
> option that adds some sort of checking to the generated code.
>
> > And why did the OS allocated more space ?
>
> The OS might allocate memory in blocks, and the smallest block might 
> be (for example) 1k. It might not be the most space efficient 
> algorithm, but it might be quicker and simpler than one that allocates 
> exactly the amount you request.
>
> If you are interested, try Googling for 'memory allocation' eg.
>
> http://en.wikipedia .org/wiki/ Dynamic_memory_ allocation
>
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
> http://in.yahoo. com/
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> 

Reply via email to