Search:

Type: Posts; User: AndiPersti

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    1
    Views
    2,579

    You should get at least a warning that atof()...

    You should get at least a warning that atof() isn't declared properly in numcmp.c.

    And this also looks strange:


    //numcmp.c
    void substr(char *s, char *t, int maxstr);
    ...
    //substr.c
    void...
  2. Replies
    3
    Views
    927

    I don't understand what your program does and the...

    I don't understand what your program does and the fact that all your names and comments are in Spanish doesn't make it easier.

    Nevertheless I just run it and it segfaults. Here's the debugging...
  3. Replies
    12
    Views
    1,312

    answer =(digit_sum , + num) / 9; What are you...

    answer =(digit_sum , + num) / 9;

    What are you trying to achieve with this line?



    if ( num % 9 >= 0)

    This expression will always be true. % 9 returns the remainder of the division by 9...
  4. Replies
    15
    Views
    2,240

    Well, you have a contradiction here. Either you...

    Well, you have a contradiction here.
    Either you know where "endText" should end or it is impossible to append a '\0'.

    If you tell us what you want to achieve, perhaps someone will find a good...
  5. Replies
    6
    Views
    13,870

    No, that line is syntactically correct. %[ is a...

    No, that line is syntactically correct. %[ is a legal format specifier. See scanf, fscanf, sscanf - cppreference.com.

    Bye, Andreas
  6. Replies
    24
    Views
    2,169

    If I compile your program from post #5 I get the...

    If I compile your program from post #5 I get the following warnings:


    $ gcc -Wall -Wextra -ggdb3 foo.c -lm
    foo.c: In function ‘fun’:
    foo.c:73:19: warning: unused parameter ‘x0’...
  7. Thread: Array Doubt

    by AndiPersti
    Replies
    22
    Views
    2,772

    The question is about the number of elements you...

    The question is about the number of elements you can store in that array.

    So, how many elements are in the first dimension (-1...m)?
    How many elements are in the second dimension (1...m)?

    If...
  8. Thread: Array Doubt

    by AndiPersti
    Replies
    22
    Views
    2,772

    You should know which programming language the...

    You should know which programming language the question is about. From where did you copied it?

    I would say it's pseudocode and thus a general question.

    Do the calculation yourself then come...
  9. Replies
    13
    Views
    2,380

    In case you haven't found out yet, gcc uses...

    In case you haven't found out yet, gcc uses command line switches to turn on warnings. I usually use -Wall and -Wextra but there are lot more. See Warning Options - Using the GNU Compiler Collection...
  10. while(str[i++]!='\0'); When str[i] == '\0' you...

    while(str[i++]!='\0');

    When str[i] == '\0' you are still incrementing "i".
    You need to increment "i" in the body if you don't want to count the '\0'.



    rev[++j]=str[--i];

    You...
  11. printf("The third letter is : %s \n",str[3]); ...

    printf("The third letter is : %s \n",str[3]);


    This will print the fourth letter (after changing %s to %c of course). Remember array indexing starts at 0.

    Bye, Andreas
  12. And to answer your other question: No there is no...

    And to answer your other question: No there is no <- operator in C.

    Bye, Andreas
  13. Replies
    7
    Views
    1,236

    You should already have mingw32-make on your...

    You should already have mingw32-make on your system.
    So just use it instead of make (which is the MS make).

    Bye, Andreas
  14. Replies
    84
    Views
    9,072

    int isNotSpecificOrder(Order ** iter){ Order *...

    int isNotSpecificOrder(Order ** iter){
    Order * tmp = *iter;
    while (tmp->isSpecific && tmp != NULL)
    tmp = tmp->next;

    Suppose "tmp" points to the last node and "tmp->isSpecific" is true. Now...
  15. I guess the assignment's purpose was to practice...

    I guess the assignment's purpose was to practice the switch statement ;-).

    Bye, Andreas
  16. Replies
    84
    Views
    9,072

    I'm afraid you rely too much on our help to...

    I'm afraid you rely too much on our help to debug/write your program.
    Just try it out yourself. Call your function with system->driversQueue being empty and see what happens (Hint: migf1 told you...
  17. Replies
    46
    Views
    7,776

    //for lines larger or equal than the size...

    //for lines larger or equal than the size limit....
    if (orig >= (PARSE_SIZE_LIMIT - 1))
    {
    for (x = 0; x <= (PARSE_SIZE_LIMIT - 1); x++)
    { subject[x] = userstring[x]; }
    }

    //for...
  18. link *printList(link *current); link...

    link *printList(link *current);
    link *populateList(link *current);

    Both functions don't return a link pointer.



    link *searchList(int value, link *head) {
    struct node *temp;
    ...
  19. Don't store the labels for the axes in the grid...

    Don't store the labels for the axes in the grid array. You only need them when you display the grid on the screen. If you do like Nominal Animal suggested (putting a '\0' at the end of each row) you...
  20. I personally wouldn't store the labels in the...

    I personally wouldn't store the labels in the grid array. IMHO this makes the code unnecessarily more complex.


    Animal Nominal told you already that the method is the same as using pen and graph...
  21. Replies
    22
    Views
    2,651

    Well, "temp" is a pointer thus sizeof(temp) will...

    Well, "temp" is a pointer thus sizeof(temp) will probably be 4 or 8 (depending on your system), i.e. not enough. You need to calculate the total amount of bytes you want to copy.
    How many bytes is...
  22. void text_test3( char *array) { char...

    void text_test3( char *array)
    {
    char char_array[5];
    strcpy( char_array, array );
    printf("%s\n",char_array);
    }
    char_array[5] will be too small if the OP wants to call...
  23. Replies
    22
    Views
    2,651

    if (k = 3) { What does the = operator do? ...

    if (k = 3) {

    What does the = operator do?

    Bye, Andreas
  24. It's probably too late, but the next time you...

    It's probably too late, but the next time you should post your code here in the forum instead of putting it somewhere to download.

    Additionally, you should only post the part you have problems...
  25. Replies
    28
    Views
    1,999

    That's a pretty useless error description. How is...

    That's a pretty useless error description. How is it not printing correctly?



    while(fread(&number,sizeof(int),1,f) == 1){
    if((x%2) == 0 || (x == 0)) {
    ...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4