Search:

Type: Posts; User: drew99

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    50
    Views
    3,236

    For example if you enter 100 it's a bad input so...

    For example if you enter 100 it's a bad input so the program prints the error message and returns you to the main menu without pressing any buttons.
  2. Replies
    50
    Views
    3,236

    Without fgetc(stdin), if you enter a bad code in...

    Without fgetc(stdin), if you enter a bad code in numbers the program jumps over


    fputs("\n------------------------ Premere un tasto per continuare ----------------------\n", S_OUT);...
  3. Replies
    50
    Views
    3,236

    This is my main: #define FLUSH(stream)...

    This is my main:



    #define FLUSH(stream) fgets(buff, 256, stream);
    #define S_OUT stderr

    void apri(articolo **start);
    void inserisci(articolo **start);
    void cerca(articolo **start);
  4. Replies
    50
    Views
    3,236

    There is no need to be offensive, I'm a novice...

    There is no need to be offensive, I'm a novice programmer and these are the situations that I can not fully manage, so I apologize if I ask you to do more work for me.
    What sense phrases like...
  5. Replies
    50
    Views
    3,236

    Can you write a short pratical example, please?

    Can you write a short pratical example, please?
  6. Replies
    50
    Views
    3,236

    I've tried in this way, but it still not working:...

    I've tried in this way, but it still not working:



    void apri(articolo **start);
    void inserisci(articolo **start);
    void cerca(articolo **start);
    void modifica(articolo **start);
    void...
  7. Replies
    50
    Views
    3,236

    Ok, but if there aren't any chars in the buffer,...

    Ok, but if there aren't any chars in the buffer, the program pauses itself until enter key is pressed...
  8. Replies
    50
    Views
    3,236

    Ok, so in general if I pass this parameter to a...

    Ok, so in general if I pass this parameter to a function, what will the function receive?



    void my_function(char *name, struct *my_struct)
    {
    //code
    }
  9. Replies
    50
    Views
    3,236

    Yeah, but it doesn't work, because if I set to 0...

    Yeah, but it doesn't work, because if I set to 0 the pointer start in one of those functions, in the main function it returns to its original value...
  10. Replies
    50
    Views
    3,236

    Another question: is it possible to eliminate...

    Another question: is it possible to eliminate start as a global variable and pass it as an argument to any function considering that they are called in this way:

    Code:



    void apri(articolo...
  11. Replies
    50
    Views
    3,236

    I think every programmer tries to write efficient...

    I think every programmer tries to write efficient code and not just follow a book.




    I can not just remove fflush (stdin), but I should replace it only if I found woking alternatives.
  12. Replies
    50
    Views
    3,236

    I just don't understand this obstinacy against...

    I just don't understand this obstinacy against goto.
    I agree that they involve a minor maintainability if it's relate to a possible repetition of instructions very far or it replaces nested loops,...
  13. Replies
    50
    Views
    3,236

    I prefer: Foo *allocate_object() { ...

    I prefer:



    Foo *allocate_object()
    {
    Foo *f;

    if ((f = malloc(sizeof *f)) == NULL)
    {
  14. Replies
    50
    Views
    3,236

    I'm making some global changes thanks to your...

    I'm making some global changes thanks to your advices and I was wondering if it was possible to eliminate start as a global variable and pass it as an argument to any function considering that they...
  15. Replies
    50
    Views
    3,236

    I'm making some global changes thanks to your...

    I'm making some global changes thanks to your advices and I was wondering if it was possible to eliminate start as a global variable and pass it as an argument to any function considering that they...
  16. Replies
    50
    Views
    3,236

    Can you tell me what are the advantages of using...

    Can you tell me what are the advantages of using cycles instead of goto?
    Looking at the assembly produced by isolating a small portion with a menu, there seems to be no substantial differences, even...
  17. Replies
    50
    Views
    3,236

    Can you post a solution without gotos, thanks?

    Can you post a solution without gotos, thanks?
  18. Replies
    50
    Views
    3,236

    I've done more test and I've found that the...

    I've done more test and I've found that the program returns an error when I try to delete the first element of the list, so the case 2 can't work!
    How is it possible that the program doesn't allow...
  19. Replies
    50
    Views
    3,236

    Ok: for(p = start, c = 0; p; p = c); ...

    Ok:



    for(p = start, c = 0; p; p = c);
    {
    c = p->n;
    free(p->name);
    free(p->des);
    free(p);
  20. Replies
    50
    Views
    3,236

    Thanks to all, but what are the alternatives for...

    Thanks to all, but what are the alternatives for goto and how can I resolve the problem with free()?
  21. Replies
    50
    Views
    3,236

    char *n_name = (char*) calloc(NAME_LENGTH,...

    char *n_name = (char*) calloc(NAME_LENGTH, sizeof(char)), *n_des = (char*) calloc(DES_LENGTH, sizeof(char));


    Your second correction is true but the for fails at the first cicle.
  22. Replies
    50
    Views
    3,236

    Problem with free()

    Hello!

    This is the problem: when I try to delete all the elements of a linked list the program returns an error while it doesn't when I do the same with only one element of the list.

    Here's the...
  23. Replies
    7
    Views
    1,106

    I've tried to print them and for each union the...

    I've tried to print them and for each union the value is correct: bk8 = 8, bk32 = 32, bk128 = 128 (sizeof)
  24. Replies
    7
    Views
    1,106

    #include

    #include <stdbool.h>
  25. Replies
    7
    Views
    1,106

    Sorry, I made ​​a mistake during the...

    Sorry, I made ​​a mistake during the transcription, Now I've fixed it.
Results 1 to 25 of 80
Page 1 of 4 1 2 3 4