Search:

Type: Posts; User: ProgrammingJedi

Search: Search took 0.01 seconds.

  1. thanks for your advice. I was just trying to...

    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...
  2. string2 is a local variable, the string which is...

    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...
  3. Replies
    2
    Views
    2,928

    if(arr[b]>arr[b+1] => if that's the case, b will...

    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....
  4. Replies
    5
    Views
    2,344

    while(c!=a) : you are comparing two pointers...

    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:...
  5. The cause of the problem might be the while...

    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...
  6. Replies
    5
    Views
    2,171

    This line doesn't make sense as far as I can see:...

    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.
  7. Replies
    3
    Views
    4,567

    strstr() is a library function that returns the...

    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...
  8. Replies
    18
    Views
    4,091

    strlen doesn't count the string terminating...

    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...
Results 1 to 8 of 8