Search:

Type: Posts; User: tuxinator

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    2,227

    Check this method out

    I got this method from the supertux source code



    #include <stdio.h>
    #include <string.h>

    int main(int argc, char *argv[])
    {
    /* Parse command line arguments */
  2. Replies
    15
    Views
    3,417

    I fixed it by changing the strings from "char...

    I fixed it by changing the strings from "char *string" to "char string[MAX_LEN]" wher MAX_LEN is 75. Then I used "char *temp_data = strtok(value, "\"");" in order to strip the double quotes off of...
  3. Replies
    15
    Views
    3,417

    This is exactly why I'm writing my own parser. Is...

    This is exactly why I'm writing my own parser. Is to learn how to do it, not just to get a task done.
  4. Replies
    15
    Views
    3,417

    Ok I've got it to work now. Except I can't figure...

    Ok I've got it to work now. Except I can't figure out how to copy the temporary value of the object into a permanent location without the temporary destination being a pointer and without getting a...
  5. Replies
    15
    Views
    3,417

    This seems like an interesting concept. Of course...

    This seems like an interesting concept. Of course it'll require a few tweaks here and there to get it to work. But I think this should work, at least for what I need it to do. Unfortunately I am to...
  6. Replies
    15
    Views
    3,417

    The problem with downloading a free parser is it...

    The problem with downloading a free parser is it is usually something you have to install wich would mean putting it as the requirements. So far my game only requires SDL and SDL_image support and...
  7. Replies
    15
    Views
    3,417

    I haven't tried this yet but I think I figured...

    I haven't tried this yet but I think I figured out what I need to do. If anybody is for sure on what to do then please say so. I'll report back as soon as I'm done with this idea. If it works then I...
  8. Replies
    15
    Views
    3,417

    Well I'm not using LISP itself. It's more of a...

    Well I'm not using LISP itself. It's more of a LISP based syntax. My reasoning is because it provides an easy to write data storage file. Have a look at the supertux source code. It uses the same...
  9. Replies
    15
    Views
    3,417

    Yes.

    Yes.
  10. Replies
    2
    Views
    1,636

    Lisp Reader Technique

    Does anyone know of a good resource to find out how to use the lisp reader technique? I need it for a game that I am developing. It's my first game and I'm still kind of a noob at game development.
    ...
  11. Replies
    15
    Views
    3,417

    Help with the Lisp Reader Technique

    Hi I am developing a game that uses Lisp based text files to store data. Although I can't seem to figure out how to right the code. Here is an example text file that I would like to load. The number...
  12. Replies
    18
    Views
    2,619

    My bad it should have been char* storage =...

    My bad it should have been


    char* storage = malloc(sizeof(char) * size+1);

    I forgot the parenthesis at the very end. Anyway this should fix the syntax error;
  13. I would recomend just not using asemble at all....

    I would recomend just not using asemble at all. It is just way to much of an ugly language that almost nobody uses anymore.
  14. Replies
    18
    Views
    2,619

    Detecting File Size

    include statements (at least the ones I am using I am not sure which one does it).


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    Code Itself:
  15. The text file is what fooled me. Since I merely...

    The text file is what fooled me. Since I merely copied and pasted the code you guys gave me I kept forgetting to change the "filename.txt" to the location of the file. It works now.

    Thanks a...
  16. I have comfirmed that it is do to the "fseek"...

    I have comfirmed that it is do to the "fseek" function as I ran it with gdb and got this:


    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 16384 (LWP 1303)]
    0xb7dc022d...
  17. Still get the segmentation fault. I changed the...

    Still get the segmentation fault. I changed the code as follows:


    FILE* pFile;
    pFile = fopen("filename.txt","rb");
    fseek (pFile, 0, SEEK_END);
    long size=ftell (pFile);
    fseek (pFile, 0,...
  18. Still segmentation faults. Please check to make...

    Still segmentation faults. Please check to make sure that I have to code correct as I may not.



    FILE* pFile;
    pFile = fopen("filename.txt","r");
    fseek (pFile, 0, SEEK_END);
    long size=ftell...
  19. The next problem: When I output the code I...

    The next problem:

    When I output the code I have it set to print the "data" variable. So the output should be something like this:


    /* This is the contents of the text file that I am trying to...
  20. The above code seems to have a problem with new...

    The above code seems to have a problem with
    new char. It seems to me that "new" is a C++ keyword and is not available in C. Not only does it not work but it also apears as if your trying to read...
  21. Storing data from a file into a single char string

    Hi I am writing a game that uses several text files for its data, and I was wondering how to store the entire data within the text file in a single character string of the char *.

    I figured...
  22. Replies
    8
    Views
    1,451

    I probably need to be a little more explanatory.

    OK I can see what your saying there but what if someone else on a nother machine is compiling this program. How then do I tell the program to find out where they compiled the program at? If you are...
  23. Replies
    8
    Views
    1,451

    Kind of

    This is sort of what I'm looking for however when I did so and ran ./configure then make it came back with the output saying that -fdatadir=DIR is an unrecognized command, but when I looked at the...
  24. Replies
    8
    Views
    1,451

    To be more specific

    When you compile the program that you've writen, I believe there is some way you can define datadir(the directory of the data source) in the config.h file that the configure script generates. But I...
  25. Replies
    8
    Views
    1,451

    Help with data directories

    I know this probably has nothing to do with the actual code itself, but how do I find out where the directory the user compiled the program in is? I am using kdevelop as my IDE and I am running...
Results 1 to 25 of 35
Page 1 of 2 1 2