Search:

Type: Posts; User: blixel

Search: Search took 0.01 seconds.

  1. I came up with a solution for this question. May...

    I came up with a solution for this question. May not be the greatest, but it works.

    I created a new file I'm calling descriptions.txt, and I'm putting the room descriptions in there in this...
  2. How to read multiple lines from a plain text file and store as a single variable.

    I've been working on a little dungeon crawling adventure just for fun. It only consists of 25 rooms at the moment, so it's very small. My little game works perfectly, but I'm currently trying to make...
  3. Ok thanks for the help. I suppose if I can do...

    Ok thanks for the help. I suppose if I can do what I'm trying to do without needing malloc, then I won't bother with it.

    I used your example to create this:



    #include <stdio.h>


    const...
  4. Returning "string" (or character array?) from a function / malloc() question.

    I am trying to figure out a good way (as in good practices I suppose) to return "string" information from a function. And by string, I think I probably mean a character array. After a bit of...
  5. Replies
    2
    Views
    571

    Awesome, thanks!

    Awesome, thanks!
  6. Replies
    2
    Views
    571

    Variable number of decimal places in float

    Hello. When you need to control the number of digits that are displayed in a float value, I know you can do (something like) this:

    float payment = 12.34;
    printf("%0.2f", payment);

    My question...
  7. Replies
    6
    Views
    4,828

    Got it. I understand the efficiency of the...

    Got it.



    I understand the efficiency of the shorter version, but computer science isn't my major, so I tend to compromise on ease of understanding. Having said that, in this particular case, I...
  8. Replies
    6
    Views
    4,828

    OK, I'll have to look into fread() and fwrite()....

    Pretty much. fgets() only works on files that don't contain any \0 characters.
    Well it probably does work, but there's no way for you to tell whether the \0's you see are from the file, or those...
  9. Replies
    6
    Views
    4,828

    Problem with C function to copy file

    Hello everyone. First time poster here.

    I'm writing 2 functions that will copy a file. The first version of my function seems to work without any problem. I say seems to as I haven't yet run any...
Results 1 to 9 of 9