Hi i am new to c++
i will be needing help
so any1 interested in helping me

Everyone will be new to something.
We were new at cycling for the first time and new at using the computer for the first time.

Even I am new at C++, but not very new :-). I have been programming in C++ for the last 6 months. My suggestion first to atleast learn basics of Object-Oriented-Design(OOD) concepts. Atleast what is an Object and what all can be done with that tiny little entity.
C++ is based on OOD, in other words max benefit of C++ is when you start using C++ for Object Oriented Designs.


Best of Luck!

hi i was taught in class while loop in which user define value will be used i was just practicing but didn't get it
just check it

#include<stdio.h>
#include<conio.h>
void main()
{
int counter,howmuch;
clrscr();
printf("How many numbers do u want to print");
scanf("%d",&howmuch");
counter=0;
while (counter<=howmuch)
{
printf("%d",counter);
counter++
}
getch();
}

Edited 5 Years Ago by Nick Evan: Added CODE-tags

It looks like you get the concept just fine. The only problems in your code are syntax related (and the poor practice of using conio.h). Fixing those errors produces working code:

#include<stdio.h>
int main()
{
    int counter,howmuch;
    printf("How many numbers do u want to print");
    scanf("%d",&howmuch);
    counter=0;
    while (counter<=howmuch) {
        printf("%d",counter);
        counter++;
    }
}

Though are you sure you're learning C++ and not C? I have trouble imagining a C++ class that starts you off with the stdio library instead of iostream.

@Kalpesh_9876543,
Yeah, it really looks like you're learning C and not C++!
By the way, looking at the clrscr() function(line 6), it looks like you're using TurboC++, isn't it?
Well, if the answer is yes, then its very bad for you, as TurboC++ is a non-standard compiler. You should try to get a standards-oriented one.
Moreover, avoid using void main, beacuse of this reason

Comments
Sound advice

Just as a side note to Narue, it's certainly possible that he's learning C++ and being taught #include <stdio.h> A lot of colleges and universities still teach using this header file, for no reason I can fathom, other than changing it would mean updating a metric ****-ton of teaching material :P

to OP, if you're doing Linux based code, use gcc. For windows, I suggest using Microsoft Visual C++ Express (the msvc compiler) or MinGW (which I don't recommend as highly. For all it's flaws, Microsoft certainly has a good IDE)

Edited 5 Years Ago by Ketsuekiame: n/a

Just as a side note to Narue, it's certainly possible that he's learning C++ and being taught #include <stdio.h>

I didn't say it wasn't possible. However, I did imply that it's unlikely.

A lot of colleges and universities still teach using this header file

Such as?

The University of Hull, The University of York, Sheffield Hallam, The University of Sheffield, The University of Nottingham, Doncaster College, Pontefract NEW College are ones that I know of =)

These are supposed to be top paid UK institutions, so some of the cheaper ones I imagine would perform similar "time saving" measures, but I can only guess.

Edited 5 Years Ago by Ketsuekiame: n/a

Comments
Fair enough.

ti ilovec++ would u suggest me any other im using it coz we have it in our class

Just as Ketsuekiame has said previously, try going for GCC if you have linux, and MSVC++ Express is very good if you have Windows. Try to avoid Dev C++ IDE, as its not updated anymore, and you can also try Code::Blocks (It supports both mingw and msvc compilers)

As a side note, if you want to go for Win32 API programming in C++ later, then you can try MSVC++ Pro Edition (It has a visual dialog-box editor, but its not free :(), or Pelles C (It has a visual dialog-box editor, and Yay! Its FREE! :))

As you're just starting with C++, you should first try to master the basic concepts. Then when you've learnt how the basic C++ works, you can start using a full-fledged IDE. But for now, just use MSVC++ Express, or gcc (if you're on linux) and dump TurboC++.

This article has been dead for over six months. Start a new discussion instead.