Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PointerFunct
#include "stdio.h" void bark(int a) { printf("I am a dog and I bark %d times",a); } void miau(int a) { printf("I am a cat and i miau %d times",a); } typedef struct { void (*talk)(int); }animal; int main(void) { animal dog; dog.talk = &bark; animal cat; cat.talk = &miau; cat.talk(2); animal pets[2]; pets[0] = dog; pets[1] = cat; int i; for(i=0; i<2; i++) pets[i].talk(2); return 1; }
run
|
edit
|
history
|
help
0
ytre
Calculate Area of Circle
4qwrfdsfsaf
FirstCProg
B_141128_MatricesSuma
FUNTION4
MergeSort
18BCE2182 ASSESS_1 Q1-9
Multiple If statements v1
18BCE2182 LAB FAT-2-A-i