Search:

Type: Posts; User: Etdim

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,579

    struct person{ char name[20][30]; ...

    struct person{
    char name[20][30];
    int age[20];
    };

    I'm passing the pointer *h to the function and I want the read data to be stored in the structure. I've done typedef...
  2. Replies
    5
    Views
    1,579

    File -> structure

    I have a problem assigning value to a variable that is in a structure.

    I think that's the row with the problem:

    fscanf(fp, "%s %d\n", h->name[c_names], h->age[c_names]);

    Is this the rights...
  3. Replies
    14
    Views
    2,373

    Ok, now I understand. But what about errors like...

    Ok, now I understand. But what about errors like

    test.c(147) : error C2143: syntax error : missing ';' before 'type'
    test.c(116) : warning C4047: 'function' : 'struct _iobuf *' differs in levels...
  4. Replies
    14
    Views
    2,373

    matsp, is there any way to tell the MSVC 6.0...

    matsp, is there any way to tell the MSVC 6.0 compiler to compile with "-ansi" - as I understood that's causing the errors.

    Surrounding with braces, as you said, works - the error in line 167 is...
  5. Replies
    14
    Views
    2,373

    if(num_people == 0){ ...

    if(num_people == 0){
    printf("No people records.");
    return 0;
    }
    int i,j,k,count; // this is test.c (167) error C2143: syntax error :...
  6. Replies
    14
    Views
    2,373

    laserlight, do you think it might be something...

    laserlight, do you think it might be something with the encoding of the file?
  7. Replies
    14
    Views
    2,373

    Here are examples. The code: for(k = 0; k...

    Here are examples.

    The code:


    for(k = 0; k <= num_people; k++)

    gives error
  8. Replies
    17
    Views
    2,579

    Thank you, I did it with bubble sorting, it's...

    Thank you, I did it with bubble sorting, it's working fine. :)
  9. Replies
    14
    Views
    2,373

    DevC++ and Visual Studio problem

    Hello. I get errors trying to compile C source written and working in DevC++. When I paste it in Visual Studio 6.0 it shows strange errors and won't compile. Can you help me with this?
  10. Replies
    17
    Views
    2,579

    Now I have another problem. I'm unable to sort...

    Now I have another problem. I'm unable to sort the names+ages alphabetically. I display them correctly, but I cannot find a suitable way to sort the 2d string array and display it (just display it...
  11. Replies
    17
    Views
    2,579

    dwks, I appreciate your help very much. Thank...

    dwks, I appreciate your help very much. Thank you.

    I added a struct to keep the names and age, so I can easily display them after that.
    Tomorrow I'll try to make it read the data from a binary...
  12. Replies
    17
    Views
    2,579

    Ok, so I made int ages[50]; int c = 0; and...

    Ok, so I made

    int ages[50];
    int c = 0;

    and in the for loop

    ages[c] = age;

    After that, when I printf age it is ok, I use another for loop and it prints all the ages.
  13. Replies
    17
    Views
    2,579

    dwks, thank you very much! It works perfectly!...

    dwks, thank you very much! It works perfectly! That's exactly how it should work. :)

    Can you help me just e little bit? I know how to store the age in an array and how to sort it and so on, but...
  14. Replies
    17
    Views
    2,579

    dwks, your code gave me strange result. Age was...

    dwks, your code gave me strange result. Age was at the place of Name and for Age there were quite big numbers - like 2101215 and so.

    Brad0407, I'm trying currently to use your suggestion for...
  15. Replies
    17
    Views
    2,579

    Thanks for your replies, guys. But can you give...

    Thanks for your replies, guys. But can you give me help about how to store the string I've split and post-split it? That's what I can't find out. I'm not so good at C, so I don't know what's the best...
  16. Replies
    17
    Views
    2,579

    Entering and splitting string

    Hello. I have a problem trying to split and store specific string.
    When user enters: Name1 10, Name 2 15, Name 3 40 I have to split it and store Names and age for other actions - like name sorting....
Results 1 to 16 of 16