I see.....thank you...
Type: Posts; User: xiromdim
I see.....thank you...
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;...
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...
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...
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...
Yes, I agree with you...
But my program doesn't work properly....where is my mistake??
I mean that "com" is a new word..the word "the" remains the same...
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..
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...
I see..
thanks!
:)
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).
:)
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...
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...
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...