Thread: getting a function to return a char array

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    the lowly newb
    Join Date
    Jan 2005
    Location
    IL
    Posts
    49
    that worked, thats strange.

    did the previous code that i posted work for you?
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life."

    "They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."

    "Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it."
    [all]- Terry Pratchett

  2. #2
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    yes, its basically the same code I originally posted in response to your post. It may appear that your compiler was causing a pointer to be returned vice a copy of the object for the non working code sample. This would thus cause you to try to access a variable that was out of scope and thus potentially (well in your case) result in shutting down your program.

    Just a theory though, maybe someone else has seen this before?
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Replies: 4
    Last Post: 11-23-2003, 07:15 AM
  5. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM