All pastes #839592 Raw Edit

r0ny

public c v1 · immutable
#839592 ·published 2007-12-31 02:52 UTC
rendered paste body
#include <stdio.h>struct somestruct {    int apples;    int mangoes;};void func(struct somestruct s){    s.apples = 10;    s.mangoes = 1;}int main(void){    struct somestruct john;    func(john);  /* passing a pointer to the struct */    printf("apple: %d\n", john.apples); /* prints "10" */    printf("mangoes: %d\n", john.mangoes); /* prints "1" */    return 0;}