Search:

Type: Posts; User: xiromdim

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    571

    I see.....thank you...

    I see.....thank you...
  2. Replies
    3
    Views
    571

    gets() and scanf("%s",...)

    in the following code, if I press enter, str[0], is '\0'.
    Why this happens? It shoudn't be chr(13)?

    #include <stdio.h>
    int main(){
    char str[10];
    gets(str);
    printf("%d",str[0]);
    return 0;...
  3. Replies
    6
    Views
    1,474

    Yes, you're right, the code doesn't even...

    Yes, you're right, the code doesn't even compile....
    I try to sort 2 numbers in ascending/descending order through pointers to functions but I'm a bit confused.....

    I'll try to fix a bit my...
  4. Replies
    6
    Views
    1,474

    Problem with pointers to functions

    Hi,
    I'm trying to write a program to sort 2 ints on ascending/descending order, using function pointers.
    here is my code so far:

    #include <stdio.h>
    #include <stdlib.h>

    int min_el(int a,int...
  5. ok! I fixed it! I made it with pointers, whose,...

    ok! I fixed it!
    I made it with pointers, whose, IMO, are better implementation for manipulating a C string...
    I'm expecting your comments....


    #include <stdio.h>
    #include <stdlib.h>
    #include...
  6. Yes, I agree with you... But my program doesn't...

    Yes, I agree with you...
    But my program doesn't work properly....where is my mistake??
  7. I mean that "com" is a new word..the word "the"...

    I mean that "com" is a new word..the word "the" remains the same...
  8. We find "the" and after each occurence of "the"...

    We find "the" and after each occurence of "the" we add the word "com".
    output:
    A: (the same)
    B:"In the com sentence words the com and the com."

    thanks in advance..
  9. find word and insert another word after that in text

    Hi,
    I have text (string) and I want to find a given word (it's ok!) and then insert another given word after the first word.
    The original string is beeing copied into a new string.
    But something...
  10. Replies
    7
    Views
    5,479

    I see.. thanks! :)

    I see..
    thanks!
    :)
  11. Replies
    7
    Views
    5,479

    I thought that *p equals '\0' is equivalent to p...

    I thought that *p equals '\0' is equivalent to p points to NULL.
    That means, that '\0' is the NULL character, but NOT the NULL pointer (as a pointer).
    :)
  12. Replies
    7
    Views
    5,479

    Thanks very much the answer.... I fixed it......

    Thanks very much the answer....
    I fixed it...
    But what is the "magic" reason that temp does not have value NULL at the end of the loop?
    You have right for the identation, as for the global...
  13. Replies
    7
    Views
    5,479

    print words of a string

    I want to print the words of a sentence, given as a string....
    But I have a problem with the end of the sentence, and cannot find the bug....
    Thanks in advance...


    #include <stdio.h>
    #include...
  14. Replies
    1
    Views
    973

    Read a string with & symbol

    Hi,
    why is this correct?


    char str[10];
    scanf("%s",&str);

    I knew that when we have strings we should not use & in scanf()...
    Thanks...
Results 1 to 14 of 14