thanks for your advice. I was just trying to help. And besides: how do you know that Daniel already understood? you should read his post first before posting comments yourself. look here: "I...
Type: Posts; User: ProgrammingJedi
thanks for your advice. I was just trying to help. And besides: how do you know that Daniel already understood? you should read his post first before posting comments yourself. look here: "I...
string2 is a local variable, the string which is associated with string2 is stored in the stack. so "return string2;" returns an address in the stack memory. it won't be accessible after the...
if(arr[b]>arr[b+1] => if that's the case, b will never be incremented.
since you are comparing two neighbouring values, you will also need extra variable, that indicates, if two values were swapped....
while(c!=a) : you are comparing two pointers which store different addresses.
area =(0.5*( a(b-c) + b(c - a)) + c(a - b)); : if you want to use the values, you have to use the asterisk-operator:...
The cause of the problem might be the while statement:
while(occurrences[i) etc.
if occurrences[i] has the value 0, all the following elements in the array won't be reset. Try a for-loop...
This line doesn't make sense as far as I can see: Following lines of code will only be executed if list is a NULL-pointer. but if list is NULL, there won't be a
list->next etc.
strstr() is a library function that returns the address of the substring. If the substring wasn't found the return value is NULL. you can't add an int-value to NULL. if you try, the program will...
strlen doesn't count the string terminating character. strlen(source) is 9, not 10.
I've also tried out the following code:
char source[10] = "01234";
printf("%lu", strlen(source));
This...