Thread: Adding C++ support to C thought library?

  1. #16
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129

  2. #17
    Registered User
    Join Date
    Jun 2008
    Posts
    266
    What are even the point of vla's? Couldn't you just use new? Aren't vla's allocated on the heap like new?

  3. #18
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    What C++ features are you needing compiled into a C program, is probably the most important question that seems to have gone unanswered thus far? You should be using a C++ compiler to compile code that is a "mix" of the two languages OR you should be using a linker to link object files that are compiled using each respective language into one binary.

    Whatever you are doing, you are probably not asking the appropriate question to accomplish the task.

  4. #19
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by lruc View Post
    What are even the point of vla's? Couldn't you just use new? Aren't vla's allocated on the heap like new?
    AFAIK, they can be allocated on the stack.

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by lruc View Post
    What are even the point of vla's? Couldn't you just use new? Aren't vla's allocated on the heap like new?
    Obviously in the examples so far, they've been on the stack, and it's irrelevant if it's the heap or the stack.
    Last edited by Elysia; 09-09-2008 at 09:02 AM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #21
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    VLAs are not an initializer feature. They have nothing to do with initializers.

    Also, they're on the stack. They're not allowed in global or member contexts. That makes them very useful for small-ish buffers where you know the size at runtime only.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programming library with built in manager
    By cyreon in forum C Programming
    Replies: 5
    Last Post: 06-26-2009, 12:49 PM
  2. standrad library
    By sarahr202 in forum C++ Programming
    Replies: 11
    Last Post: 05-18-2009, 08:50 PM
  3. Shared library design problem
    By p1r0 in forum C++ Programming
    Replies: 9
    Last Post: 03-23-2009, 12:36 PM
  4. static data structure in a library
    By melight in forum C Programming
    Replies: 6
    Last Post: 01-10-2009, 11:12 AM
  5. university library
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-10-2003, 03:05 PM