Thread: for (int j=0...)

  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,897
    >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