Search:

Type: Posts; User: Baaaah!

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    5,121

    Cool. Thanks Dave. Something new to learn :)

    Cool. Thanks Dave. Something new to learn :)
  2. Replies
    2
    Views
    5,121

    Reading individual strings from an array.

    If I have an array containing a string:



    char line[] = "My name happens to be Foo.";


    Is there a way to read each string from the array i.e 'My' then 'name' etc? Or can I only grab...
  3. Thread: nothing works

    by Baaaah!
    Replies
    2
    Views
    1,531

    It's not due to this is it? click here...

    It's not due to this is it?
    click here
  4. Thread: C For Dummies

    by Baaaah!
    Replies
    7
    Views
    1,376

    I think it depends on how much previous...

    I think it depends on how much previous experience of programming you have. 'C for Dummies' is good if you know absolutely squat - and I'm talking about not even knowing what a variable is - it's...
  5. Replies
    9
    Views
    1,830

    You could perhaps try this: while((c =...

    You could perhaps try this:



    while((c = fscanf(fptr,"%s", a)) != EOF)


    Note the additional brackets around the fscanf() function. This will force fscanf to be executed first and pass a...
  6. Replies
    16
    Views
    21,938

    :p if only that were true. Thanks for the...

    :p if only that were true.

    Thanks for the responses. I get most of it - not all :). It's clearer than before anyway.
  7. Replies
    16
    Views
    21,938

    kungtotte - ah I see, thanks :) . Is there a way...

    kungtotte - ah I see, thanks :) . Is there a way to stop it writing into unallocated memory?
  8. Replies
    16
    Views
    21,938

    The compiler I'm using is MinGW. I've just tried...

    The compiler I'm using is MinGW. I've just tried it with the Digital Mars complier and it works with that as well. Confused.
  9. Replies
    16
    Views
    21,938

    Dynamic allocation (I thought it would crash)

    I've been trying to learn a bit about dynamic allocation in my noobish way, and I decided to see what would happen if I deliberately tried to cram too much data into a memory block that is too small...
  10. Replies
    11
    Views
    1,023

    Warning. Noob reply

    I've messed with it a bit. I can't get it to print out the float value correctly though.



    #include <stdio.h>
    #include <math.h>

    #define size 10

    void print(float a[]);
  11. Replies
    11
    Views
    1,023

    Unless I just can't see it, you don't actually...

    Unless I just can't see it, you don't actually appear to have called your print() function at any point in main()
  12. if (ch = "\n") NumberOfLines++; Shouldn't...

    if (ch = "\n") NumberOfLines++;


    Shouldn't this be:



    if(ch == '\n')
    NumberOfLines++;
  13. Have you tried 'fgetc', instead of 'getc'?

    Have you tried 'fgetc', instead of 'getc'?
  14. Replies
    2
    Views
    1,122

    How can you pour one 'unit' - whatever that means...

    How can you pour one 'unit' - whatever that means - from the coke bottle to the pepsi bottle, when both bottles start full to begin with :confused:
  15. Well, finally got around to trying to correct the...

    Well, finally got around to trying to correct the problems with this program and I think I've got it working roughly the way that I wanted it to. I've tried to keep things as simple as possible in...
  16. Replies
    4
    Views
    1,744

    If you declare the variable outside of the 'for'...

    If you declare the variable outside of the 'for' loop - which I assume you have done - then the altered value from the loop will be carried over to the next function/operation in your program, so you...
  17. hk_mp5kpdw: :cool: wow thanks. I see what your...

    hk_mp5kpdw: :cool: wow thanks. I see what your saying. It'll give me more feedback on what's occurring, or not occurring, in the program - assuming I implement it correctly of course. :) I'm going...
  18. Errrr... ok. You got me there, I don't know how...

    Errrr... ok. You got me there, I don't know how to do that. Is there any info on this I can read. Cheers.
  19. Replies
    4
    Views
    1,523

    I'm not sure that you'd really need to have...

    I'm not sure that you'd really need to have multiple files for a program of this size - unless of course the object of the lesson was to get you writing your own header files. Are you sure that your...
  20. cwr: does '[^\n]' mean, ignore newline character?

    cwr: does '[^\n]' mean, ignore newline character?
  21. dwks: Thanks, I'll give that a go too. :)

    dwks: Thanks, I'll give that a go too. :)
  22. Thanks for the response guys. itsme86: yeah, I...

    Thanks for the response guys.

    itsme86: yeah, I think I see what you're saying there. I'm basically trying to cram a very large peg into a very small hole, so to speak. I'm still not 100% clear on...
  23. Problem moving data between 'txt' files using: fopen, fscanf & fgets.

    Hi. I'm noob to this programming business and as part of a self-inflicted learning exercise, I've been trying to write a programme that functions as follows:

    - read a string (single word) from...
Results 1 to 23 of 23