how to execute a c++ prog in a c compiler

This is a discussion on how to execute a c++ prog in a c compiler within the C++ Programming forums, part of the General Programming Boards category; Spot on Nodveidt, most reports I read stated that about MS. But I used MSVC++6.0 in college and thought it ...

  1. #16
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Spot on Nodveidt, most reports I read stated that about MS. But I used MSVC++6.0 in college and thought it was an ok peice of software. Although now I use 2003.net over it, I don't feel I need to use it again. Wait untill version 10 comes out, ( MSVC++2006 ) that should be somthing special
    I'm just trying to be a better person - My Name Is Earl

  2. #17
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Quote Originally Posted by CornedBee
    Although C and C++ are very similar, still asking a C compiler to compile C++-specific code is, in the end, like asking a Fortran compiler to compile Haskell: completely absurd.
    Well, writing a program in Haskell in general is absurd (I hate Haskell)

    Quote Originally Posted by Hussain Hani
    take this as a rule :
    Any C++ compiler can compile both C++ and C codes

    Any C compiler can only compile C code
    Actually, that's not true.

    Firstly, C++ requires explicit casting in some cases where C does not (example: casting from void pointer), so you'll get compile errors until you explicitly cast.

    Secondly, C++ is a superset of C89, not C99. None of the changes made to the C language in the 1999 revision will be found in C++. For example, the following is valid C:
    Code:
    int x = 22;
    int vec[x];
    double vec2[6] = {[1]=1.0,[5]=3.0};
    int * restrict ptr = vec;
    yet only the first line will compile in C++.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #18
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    That is pretty fancy C voodoo type stuff... I could see that being handy in C++ Then again most times when I would use it, I could just use a vector or other container.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 09-16-2006, 01:18 PM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 05:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 10:28 AM
  5. Help With finding a compiler
    By macman in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-15-2005, 08:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21