Search:

Type: Posts; User: a_satari

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    46,805

    Thanks itsme86. I don't completely understand how...

    Thanks itsme86. I don't completely understand how 0 marks the end of line either.
    I think it may be to do with reading the character using getc then converting it to an int using
    atoi.
    I'm going...
  2. Replies
    11
    Views
    46,805

    what I'm really trying to ask is, how do you...

    what I'm really trying to ask is, how do you determine end of line?
    In my outputs, the end of line is represented as a 0.
    I want to get rid of this. So far I've used if statements to check for the...
  3. Replies
    11
    Views
    46,805

    how to detect end of line

    Hi. I'm reading integers from a file and placing them into an array.
    How do you detect for end-of-line? I've tried checking using '\0' and '\n', neither works.
    If I can detect the end-of-line then...
  4. Replies
    3
    Views
    2,077

    something wrong with my fscanf?

    Hi. I'm trying to place the contents of a text file with integers into an array.
    But the wrong values are being output to the screen:


    FILE *fin;
    char file_name_in[20]= "test.txt";
    ...
  5. Replies
    9
    Views
    17,293

    Thanks anduril462. I think your right about...

    Thanks anduril462.
    I think your right about spitting out the address of int_array.
    I've changed my code to match what you've and Bayint have said:


    while((getc(fin))!=EOF){
    ...
  6. Replies
    9
    Views
    17,293

    Thanks, Baynit and CommonTater. Baynit: I...

    Thanks, Baynit and CommonTater.

    Baynit: I tried your solution and got the same answer.
    In the line:
    int_array[i] = fgetc(fin);
    fgetc gets the character and places it into int_array, which is...
  7. Replies
    9
    Views
    17,293

    How to use fgetc

    Hi. Think I'm having trouble with fgetc.
    I'm trying to read from a text file containing integers and write to an
    integer array.

    The text file contains: 9876 54321
    the output from the array...
  8. Replies
    2
    Views
    3,063

    My first years C programming project was to...

    My first years C programming project was to create a Rot13 cipher program. The user would enter some text and the program changes it into the cipher. This might be a bit too easy for you.

    I'm...
  9. Replies
    4
    Views
    1,409

    I checked the short cut under...

    I checked the short cut under start>>programs>>Bloodshed Dev-C++>>Dev-C++ and it links to C:\Dev-Cpp\devcpp.exe. However Dev-Cpp does not exist under C. This is where I think I installed it and this...
  10. Replies
    4
    Views
    1,409

    Thanks for you advice tabstop. I'll see if I...

    Thanks for you advice tabstop.

    I'll see if I can match those up tomorrow. Its very late now.

    Re: code::blocks - I'll give that a try. Although it means learning a new environment.
  11. Replies
    4
    Views
    1,409

    Missing shortcut, faulty HD?

    hi,

    I installed Dev-C++ on my laptop yesterday and was able to work with it. Today, when I try and open it, I get a 'missing shortcut' error. This has happened one before with Dev-C++ and I just...
  12. Thread: Files

    by a_satari
    Replies
    5
    Views
    1,364

    you forgot to enter a \ in [\code]. thanks.

    you forgot to enter a \ in [\code].

    thanks.
  13. Replies
    6
    Views
    3,616

    Brilliant hk_mp5kpdw, that worked. I'm not...

    Brilliant hk_mp5kpdw, that worked.

    I'm not sure what, 99[^\n] does though.

    "%s", must only accept a string untill a space is pressed, so 99[^\n] must accept 99 charaters?

    edit: %s is a...
  14. Replies
    6
    Views
    3,616

    Thanks Epy. I haven't been able to find a...

    Thanks Epy.

    I haven't been able to find a good example of fgets and as far as I can see it only referes to reading data from files. Can you point me to a good example of fgets?

    I'll keep...
  15. Replies
    6
    Views
    3,616

    How to handle spaces in strings

    Hi everyone,

    I'm writing code that uses an encoding called rot13, where each letter is shifted 13 spaces, so "a" becomes "n" and "b" becomes "o" etc. It was an old C assignment.

    The problem:
    ...
Results 1 to 15 of 15