visual c++ problem

Discussion in 'Programmer's Corner' started by eggtree, Nov 30, 2006.

  1. eggtree

    Thread Starter Member

    Nov 28, 2006
    27
    0
    I wanted to start write C++ program from fresh.I mean writing a program line by line and not getting templete from the internet or libuary.

    I got a visual C++ version6 cd install in my pc and used it. When I type some line on a text, click bulid.It always appear 0 error and 0 warning.

    I remember during school time, when i write a program, whenever there is error.It will prompt exemple 3 errors and 1 warnings.

    Can somebody advise please.Thanks.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    I may just be ignorant, but I would interpret 0 errors and 0 warnings as evidence of valid code. Of course, no compile-time errors does not mean no run-time errors...
     
  3. EEMajor

    Well-Known Member

    Aug 9, 2006
    67
    4
    I would also think that zero errors and zero warnings are good. When I was taking my C++ class I was always happy to get this result!

    If you are worried, try typing in some bad code, for example, type in this line:

    cout >> "\nThis Should Not Work!!";

    Notice the >> instead of <<. If the compiler does not give you an error, then there is a problem.
     
  4. sci-3d

    Well-Known Member

    Aug 22, 2006
    51
    0
    Before using VC++, it requires the basic understanding of Object Oriented Programming (OOP) ie.,

    Class
    Properties
    Method
    Object
    Polymorphisms
    Inheritances
    .....

    I think you can study from the book of C++ Primer.
     
  5. eggtree

    Thread Starter Member

    Nov 28, 2006
    27
    0
    I mean when I type in nonsense, it also display 0 error 0 warning.
     
  6. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    3
    Most probably because that file is not included in the project or project list of compileable files.
     
  7. eggtree

    Thread Starter Member

    Nov 28, 2006
    27
    0
    Hi, pls kindly tell me the step to include the file in the project.million thanks.
     
  8. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    Do you have any literature with VC++? There is a set of operations you have to invoke before entering programming code in the editor, as explained in the manual/programming guide. Can you give us an example of your work?
     
  9. serg_zone

    New Member

    Dec 2, 2006
    4
    0
    yes, your C++ file is useless unless it is included in some other project. For instance, if it's an implementation file for a class, you'd have to refer to it from the header file of your class. Otherwise the file will be left alone and the compiler will never read it as it is not a part of your project.
     
  10. eggtree

    Thread Starter Member

    Nov 28, 2006
    27
    0
    I did a few program project in school day.The platform is execute i ms dors base.build - save text - if zero error n warning - execute the program in ms dos - key in inout - get output

    Current working pace only use template in the software libuary or internet. But I have forgotten the basic so I intend to start over again.
     
  11. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    3
    Look in the VC++ manual on how to create a project and add new files. There are short tutorials included there.
     
  12. eggtree

    Thread Starter Member

    Nov 28, 2006
    27
    0
    Thks for the info.I will do that.
     
  13. rjKing

    New Member

    Mar 17, 2007
    2
    0
    Actually, this is not required. You can write what looks like traditional C code in C++ and for the most part it will compile and work just fine. There are some differences in how some expressions are parsed, but they end up being improvements over traditional K&R C anyway (at least in my opinion).

    You can choose to layer your understanding of OO as needed.. but its not required with VC++.. it even retains the basic implementation of the standard library.
     
Loading...