C Saved Program: fragrant-terrain

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


typedef struct slot {
    int value;
    char arr[10];
    char *cp;
    struct slot *sp;
int main() {
    slot a, b, *p, *q;
    a.sp = &b;
    p = &b;
    q = &a;
    p->sp = &a;
    p->cp = &(q->arr[5]);
    b.cp = &(b.arr[1]);
    p->value = b.cp - p->cp;
    q->value = 10;
    strcpy(b.arr, "hello"); 
    strcpy(a.arr, "qwrtyuipav");
    printf("%d %d %s", a.value, b.value, b.arr);
    if(*b.cp == 'l')   
        printf(" yes");
    *a.cp = 20;    
    return 0;


Press the execute button or CTRL + enter to run code.