Search:

Type: Posts; User: Molokai

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,541

    Umm, it's not overwriting past the array. Look...

    Umm, it's not overwriting past the array. Look closer at the code:


    int line = 0;
    int parent = 0;
    while(fgets(text, 255, textFile))
    {
    if(feof(textFile))
    break;
    ...
  2. Replies
    5
    Views
    1,541

    Thank you for the hint about data already being...

    Thank you for the hint about data already being an array, as that's all I needed, and the clarification on strncpy was useful, but line is perfectly fine the way it is. Thanks anyway.
  3. Replies
    5
    Views
    1,541

    Passing struct pointers

    OK, so this program is made to read text files, split the lines into types (based on content of the lines), and then, (eventually), create a binary file from selected descriptions and their child...
  4. Replies
    27
    Views
    2,297

    Ugh... *double facepalm*... Thanks, bithub.

    Ugh... *double facepalm*... Thanks, bithub.
  5. Replies
    27
    Views
    2,297

    OK, new problem with the file name creator. ...

    OK, new problem with the file name creator. Here's what I've got so far (for that):
    chr = strrchr(argv[0],'\\');
    if(chr == NULL)
    {
    puts("\nError: unable to find \"\\\" in...
  6. Replies
    27
    Views
    2,297

    And to think it was a simple case of buffer...

    And to think it was a simple case of buffer overflow this whole time (or possibly buffer underflow)... I totally did not see those two words in your post the first time...

    I finally figured to...
  7. Replies
    27
    Views
    2,297

    Yeah, but still none of that is helping the...

    Yeah, but still none of that is helping the problem. In fact, I figured out that the problem is in fact this block of code:
    strncpy(newSaveName, (char*)argv[0], chr-argv[0]+1);

    chr =...
  8. Replies
    27
    Views
    2,297

    Alright, this is what I have now: #include...

    Alright, this is what I have now:

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

    main(int argc, char *argv[])
    {
    FILE* originalSave;
  9. Replies
    27
    Views
    2,297

    Well that's all I wanted to know... Was there an...

    Well that's all I wanted to know... Was there an easier way to do that, or was I doing the best thing I could? LOL. Anyway, all of this still hasn't solved the problem of it not working on other...
  10. Replies
    27
    Views
    2,297

    Well, that's what I'm saying, I don't want the...

    Well, that's what I'm saying, I don't want the current working directory, I mistyped that. I want the app's absolute path value.
  11. Replies
    27
    Views
    2,297

    Well, no, to me full app path is not irrelevant,...

    Well, no, to me full app path is not irrelevant, because it's apparently not the directory it works in. This isn't an app I would have people install, it would just be downloaded and extracted, so I...
  12. Replies
    27
    Views
    2,297

    @tabstop: Yeah, by "package" I mean put the...

    @tabstop: Yeah, by "package" I mean put the executable together with the new directory and the file I'm testing with, move it to another computer, and test it there. And "stops responding" refers...
  13. Replies
    27
    Views
    2,297

    @tabstop: I'm not compiling or building or...

    @tabstop: I'm not compiling or building or coding in VS. I really don't like it. Right now, for lack of a better editor/compiler, I'm using Dev-C++.

    @Sebatiani:That one I don't have any...
  14. Replies
    27
    Views
    2,297

    Working app crashes on other computers

    OK, so here's my problem now. This whole bit of code works perfectly (as long as you're converting a certain type of file). However, when I package the whole thing and try to run it on any other...
  15. Replies
    10
    Views
    1,807

    Ah, yes, of course. I needed a little allocation...

    Ah, yes, of course. I needed a little allocation for that. Thank you so much. It all works perfectly now.

    And yes, I had those slashes straightened out a while ago. Darn escape characters,...
  16. Replies
    10
    Views
    1,807

    Yes, I am trying to build the full path. That's...

    Yes, I am trying to build the full path. That's why I was trying to pass all those different portions of the path in the first place.

    Here's my whole code as it stands now:
    #include <stdio.h>...
  17. Replies
    10
    Views
    1,807

    Yeah, I got that one. The batch file is all...

    Yeah, I got that one. The batch file is all setup now.

    Now I'm getting the problem that it won't open the new file correctly... Is there some alternative to sprintf that I can use? (other than...
  18. Replies
    10
    Views
    1,807

    I'm using dev-c++ to compile (using, I think,...

    I'm using dev-c++ to compile (using, I think, cygwin, maybe gcc, not sure).

    Turning echo back on gives me this output:
    C:Documents and Settings\User>set batPath=C:\Documents and Settings\User\My...
  19. Replies
    10
    Views
    1,807

    No, that's not the problem, because otherwise I...

    No, that's not the problem, because otherwise I would get something like
    savePath = C:\Documents
    name = and
    ext = Settings\User\My
    Here's what the batch file does:
    @echo off
    :start

    set...
  20. Replies
    10
    Views
    1,807

    improper file path string handling

    OK, so I figured out my problem with the endian swapping portion of my program, and now I'm trying to get it to handle file naming, etc. So I'm passing various portions of the file path to the...
  21. OK, so I dereference it. That works. It makes...

    OK, so I dereference it. That works. It makes it compile, and so I run it (drag and drop) with a file that has hex values of 043E7A4F. But my output confuses me... I get:
    Original hex: 3E24E0...
  22. OK, so I put in the pointer reference (&), and I...

    OK, so I put in the pointer reference (&), and I still get those errors... Here's what they are exactly:


    main.cpp invalid operands of types `uint32_t**' and `int' to binary `operator>>'
    ...
  23. Endian swapping (byte-order reversal) on a file

    OK, so I found the C programming posts by a few people about byte-order swapping, and I've got that working just fine, but I'm a little confused as to how to grab those informations from a file,...
  24. Replies
    8
    Views
    1,697

    Oh, so for if (x == y-1), that's ok, because y-1...

    Oh, so for if (x == y-1), that's ok, because y-1 has to be executed for the == to be evaluated. That's a good tidbit. Thanks tabstop.
  25. Replies
    7
    Views
    2,140

    Ah, OK, so I start with i = 1 and run through the...

    Ah, OK, so I start with i = 1 and run through the argv[]. Is argv really in char format, and does that mean that it would be in something like argv[argc][] format, or is it really a string array? ...
Results 1 to 25 of 77
Page 1 of 4 1 2 3 4