[ create a new paste ] login | about

Link: http://codepad.org/D2DTYX8F    [ raw code | output | fork ]

C, pasted on Mar 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
int len = 0;
char str1(char string){
    char *p = &string;
    while(1){
        p = &string;
        if(*p == '\n'){
            break;
        } else {
            *p++;
        }       
    }
    return len;
}
int main (void){
    char string[10]="Trung Dep ";
    len = str1(string);
    printf("Value of x = %d\n",len);
}
  


Output:
1
Timeout


Create a new paste based on this one


Comments: