Search:

Type: Posts; User: m_programmer

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,150

    thanks man,, i forgottt about that,,, :DD

    thanks man,, i forgottt about that,,, :DD
  2. Replies
    5
    Views
    1,150

    thanks so fixed that and here is my modified...

    thanks so fixed that and here is my modified code.. but this time,, the read function works perfectly fine but the write function writes " 0.0000 0.0000" every time i run the program...


    ...
  3. Replies
    5
    Views
    1,150

    Reading and Writing to a file

    hi everyone.
    so i am writing this program that reads some data from a file and store the data into an array of struct then finding the minimum "height" from the array and writing the "height" and...
  4. Replies
    8
    Views
    1,258

    so i fixed those errors,, but i still get the...

    so i fixed those errors,, but i still get the following outputs for an input file that contains the data:
    real 5.5
    integer 2
    character c

    OUTPUT:
    Number of Lines: 3
    eal 5.500000
    Invalid!...
  5. Replies
    8
    Views
    1,258

    @qny, thanks that worked... but nowww when i run...

    @qny, thanks that worked... but nowww when i run the program with a file like this:
    real 5.5
    integer 2
    character c

    i get an output something like this:
    Number of Lines: 3
    eal 0
    Invalid!...
  6. Replies
    8
    Views
    1,258

    reading a file

    hi,
    i have a struct that holds variables of different data types. i am trying to read the first character of data from a data file and store the data into the struct..

    the file holds data like...
  7. Replies
    11
    Views
    1,057

    thank you all,, @salem, the numLines() works fine...

    thank you all,, @salem, the numLines() works fine for me.. it gives me the exact number of lines..
    @waltP, closing and opening the file worked,, thanks alot...
  8. Replies
    11
    Views
    1,057

    I am still getting some random output,, like i...

    I am still getting some random output,, like i mentioned in post #1,,,, please help..!!
  9. Replies
    11
    Views
    1,057

    if( f != NULL){ lenght = numLine(f); ...

    if( f != NULL){
    lenght = numLine(f);
    printf("number of lines : %d\n", lenght);
    rewind(f);
    fileCommand* fCommand = malloc(sizeof(*fCommand) * lenght);




    is...
  10. Replies
    11
    Views
    1,057

    so i added rewind(fileNames); before ...

    so i added
    rewind(fileNames); before
    fclose(fileNames); in the numLines()... but it still outputs something like this..
    "number of lines : 5
    x7;...
  11. Replies
    11
    Views
    1,057

    so once i have read until the end of the file...

    so once i have read until the end of the file using numlines(),, how do i get back to the start of the file??
  12. Replies
    11
    Views
    1,057

    reading a file

    i am new to c,
    so i am writing this function that reads the content a file into an array of struct,, the code compiles perfectly fine but when i run the program it outputs something like this.. ...
  13. anduril462...

    anduril462, thank u so much,, i looked at the link u gave,,, they helped me alot,, anddd all those tip were really helpful too...

    i found all of the bugs and fixed themm all... thanks again,,
  14. reading the content of a file into an array of struct

    i am writing a function that reads the content of the file into a dynamically-allocated array of "Point" struct.



    #include <stdio.h>
    #include <stdlib.h>
  15. Replies
    6
    Views
    1,105

    thanks for the response grumpy.. well i just...

    thanks for the response grumpy..
    well i just forgot to include one declaration .

    and i did put information about the error messages .. if you look at my code ,, it is commented next to the line...
  16. Replies
    6
    Views
    1,105

    FIXEDDDD.............! thanks guys

    FIXEDDDD.............!

    thanks guys
  17. Replies
    6
    Views
    1,105

    yeah sorry i forgot to include it here... ...

    yeah sorry i forgot to include it here...

    node *head = NULL; //declare head

    yes, i have read the error messages,, but i cant seem to figure why am i getting those errors.. :((
  18. Replies
    6
    Views
    1,105

    compilation error -

    hi guys... i am having some trouble implementing an insert function for a linked list...

    this is my code so far..



    //header file
    typedef struct{
    char *comName;
    int comValue;
  19. Replies
    6
    Views
    20,535

    haha,, thanks guys... i got confused for a...

    haha,, thanks guys... i got confused for a second..! :DDD
  20. Replies
    6
    Views
    20,535

    thank you grumpy. yes i did include stdlib.h,,...

    thank you grumpy.
    yes i did include stdlib.h,, i just forgot to paste it in the forum...

    now that i fixed that problem, i keep getting the error, ":32: error: 'comName' undeclared (first use in...
  21. Replies
    6
    Views
    20,535

    expected expression before ')' token

    hi i am new to c, i keep getting this error. ":32: error: expected expression before ')' token"

    here is my code.


    typedef struct{
    char* name;
    int comValue;
    }comName;
Results 1 to 21 of 21