Thread: Function to reset variables

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by creeping death View Post
    surprising that MS doesnot allow nested functions...oO
    Because they're not standard? Because they are compiler extensions?

    Quote Originally Posted by creeping death View Post
    yeah, sure original C did not have it because of the call stack issues...but nested functions comes in handy at times...
    I fail to see such a situation. Can you elaborate?

    anyways...its upto the OP to see if it works on his compiler or not...
    This forum is about standard compliant and portable code your code is not very standards compliant, is it?
    If you don't mind, please avoid such suggestions.
    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.

  2. #17
    Registered User matrixx333's Avatar
    Join Date
    Mar 2009
    Posts
    67
    So what I'm gathering from what Elysia is saying is I should stick to using pointers in this situation and avoid using nested functions since that seems to be compiler dependent and not standard C?

    I am asking because I have learned in the past when you learn a new skill, its much easier to learn it the correct way the first time through than to have to go back and try to correct your habits later down the road..........and since I am new to programming, I want to make sure I "develop" the correct habits.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yes, you have little to gain from nested functions, so relying on them is pretty bad since it's not standard C. I would not recommend it.
    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.

  4. #19
    apprentiCe
    Join Date
    Oct 2008
    Location
    Hyderabad,India
    Posts
    136
    Quote Originally Posted by Elysia View Post
    Because they're not standard? Because they are compiler extensions?




    I fail to see such a situation. Can you elaborate?
    please see the link below...
    http://discuss.joelonsoftware.com/de...w.11.431470.11

    This forum is about standard compliant and portable code your code is not very standards compliant, is it?
    If you don't mind, please avoid such suggestions.
    i wouldnt recommend it, but it does not hurt to know that you have an option, if you use gcc...who knows might come handy someday....knowledge is power

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by creeping death View Post
    I see a lot of discussion about whether nested functions are possible and technical discussions about them, but not a good application for them.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Return Statement
    By Daveo in forum C Programming
    Replies: 21
    Last Post: 11-09-2004, 05:14 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM