for (int j=0...)

This is a discussion on for (int j=0...) within the C Programming forums, part of the General Programming Boards category; In my TCLite compiler I can use Code: for (int j=0; j<max; j++) but in my Board TurboC++ I can't ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    104

    for (int j=0...)

    In my TCLite compiler I can use
    Code:
    for (int j=0; j<max; j++)
    but in my Board TurboC++ I can't (I have to declare int j outside). Is there a way I can enable it in there?

    btw I HAVE to use B Turbo C++.

  2. #2
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    this piece of code:
    Code:
    for (int i = 0; i < SIZE; i++)
    is C++ code, and a C compiler won't compile it.
    I have never used Turbo C++ before, but looks like it's a C++ compiler, so what extension are you using, .c or .cpp?
    Last edited by glUser3f; 11-27-2003 at 04:12 PM.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    104
    well i guess ill check\change the extension and see.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >is C++ code, and a C compiler won't compile it.
    If the compiler is conformant with C99 it will compile and is valid within the standard. Otherwise it's a nonstandard extension or C++.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. template overloading question
    By plutino in forum C++ Programming
    Replies: 14
    Last Post: 02-27-2009, 02:10 AM
  2. function wiht dynamic parameters (f(int i,...) )
    By stormbringer in forum C Programming
    Replies: 1
    Last Post: 12-10-2002, 10:00 AM

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