Search:

Type: Posts; User: ramparts

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,016

    haha...not quite my first post, glad you like the...

    haha...not quite my first post, glad you like the name, and thanks for the code help :)

    Now to just delete this thread...
  2. Replies
    35
    Views
    4,859

    OK...so how do I go about fixing this? Like I...

    OK...so how do I go about fixing this? Like I said, I'm fairly new to C, I'm not sure how it all works yet...
  3. Replies
    9
    Views
    2,016

    Yeah, I only have save, go advanced, and cancel...

    Yeah, I only have save, go advanced, and cancel (just for the first post)......too late, I guess?
  4. Replies
    35
    Views
    4,859

    Thanks so much! Sorry to keep asking questions...

    Thanks so much! Sorry to keep asking questions but I'm not 100% sure how to fix this here...it crashes (at some point in the program) when I try declaring modelfile as either:

    char *modelfile[19];...
  5. Replies
    9
    Views
    2,016

    I tried that, I can't see where it lets you...

    I tried that, I can't see where it lets you delete.
  6. Replies
    9
    Views
    2,016

    EDIT: I feel kind of dumb, I just forgot to...

    EDIT: I feel kind of dumb, I just forgot to assign the third float in fscanf to a variable....it all works well now. How do I delete this?
  7. Replies
    9
    Views
    2,016

    Need help opening a series of files

    So I'm writing a function in my program which will, among other things, open a bunch of files and read data from them through a for loop. The file names are in the format "Lightcurves\modelB.##.mag"...
  8. Replies
    35
    Views
    4,859

    But I need the * so I can pass it to...

    But I need the * so I can pass it to fopen()...when I remove the * from *modelfile I get a few problems, most importantly that it no longer opens the files. Also...which functions should I be...
  9. Replies
    35
    Views
    4,859

    OK! I've slightly (haha, slightly...) modifed my...

    OK! I've slightly (haha, slightly...) modifed my code. The good news is, it compiles and then opens up all the files! The bad news is, even though it compiles and runs, I get warnings when I compile....
  10. Replies
    35
    Views
    4,859

    OK, new development, so this always fails the...

    OK, new development, so this always fails the first time through, but then on subsequent loops, it opens up the file just fine....
  11. Replies
    35
    Views
    4,859

    Yes, but I'm trying to read files that already...

    Yes, but I'm trying to read files that already exist, not write to new ones. It's not finding the files when I build the string, but it is finding them when I type in the same string manually.
  12. Replies
    35
    Views
    4,859

    Erm, if I'm not being totally clear here,...

    Erm, if I'm not being totally clear here, basically the issue is that when I create the string by adding together different bits, it doesn't find the file, but when I create the same string by typing...
  13. Replies
    35
    Views
    4,859

    Ah, works like a charm--thanks so much! Now, when...

    Ah, works like a charm--thanks so much! Now, when I try to open the file, it doesn't quite work. I know I'm pointing to the right location because the file does open when, after all that code, I say...
  14. Replies
    35
    Views
    4,859

    Thanks so much! I have it working pretty much...

    Thanks so much! I have it working pretty much perfectly. The one thing is that, when I add it into the loop (so instead of making inc[]="00", I make it equal that when i=0 in the for loop), I get...
  15. Replies
    35
    Views
    4,859

    It crashes at the sprintf. All I want to do is...

    It crashes at the sprintf.

    All I want to do is make a string saying "modelB.00", "modelB.05", etc., for i=0, 5, etc., this really shouldn't be this difficult--is there not another way to do this?
  16. Replies
    35
    Views
    4,859

    Ooh, sorry, forgot to mention, modelname is...

    Ooh, sorry, forgot to mention, modelname is defined globally as:

    char *modelname = "modelB.";
  17. Replies
    35
    Views
    4,859

    I'm really sorry, I don't quite know enough about...

    I'm really sorry, I don't quite know enough about pointers to pick that up right away, I'm learning as I go along...how do I fix this?

    Note: The reason I'm using modelfile as a pointer is because...
  18. Replies
    35
    Views
    4,859

    Here's new code. I removed the print but I'm...

    Here's new code. I removed the print but I'm getting a similar error when I use the string inc to make a new string. Here:


    int i;
    char *modelfile;
    char inc[10];
    for (i = 0; i...
  19. Replies
    35
    Views
    4,859

    Thanks! This works but my program now crashes...

    Thanks! This works but my program now crashes when I try :) I mean, assuming my code makes the string properly, this isn't a big deal if all I can't do is print it, but I'd still like to fix it....
  20. Replies
    35
    Views
    4,859

    sprintf giving me issues

    This is probably very basic but I'm not sure where I'm going wrong here...I want to have a loop going through numbers from 0 through 90 in increments of 5, and making them into strings ("00", "05",...
  21. Replies
    3
    Views
    2,814

    Thanks! Got it now :)

    Thanks! Got it now :)
  22. Replies
    3
    Views
    2,814

    Reading in char for float with scanf

    I'm using scanf to read floats from input and want to put in error handling to detect when the user is inputting something that isn't a number (that is, a string). When I type in a string, it seems...
  23. Replies
    4
    Views
    1,629

    Got it, thanks!

    Got it, thanks!
  24. Replies
    4
    Views
    1,629

    Ahh, OK. How do I round, then? The round...

    Ahh, OK. How do I round, then? The round functions I've found round it to the nearest integer. Is there an easier way than multiplying by 10^x first?
  25. Replies
    4
    Views
    1,629

    Precision with floats

    I'm using fscanf to input floats from a file, how do I specify the number of decimal places I want read? The inputs are things like "123.456" and not "123.4560000" (or, as sometimes happens,...
Results 1 to 25 of 25