#include <stdio.h>void first(){ printf("first");}void second(){ first();}void third(){ second();}void main(){ void (*ptr)(); ptr = third; ptr();}
#include <stdlib.h>#include <stdio.h>int main(void){ int* p = NULL; struct S *s = NULL; void(*f)(int, double) = NULL; char *ptr = malloc(15); if (ptr == NULL) printf("Out of memory"); free(ptr);}
#include <stdio.h>struct p{ struct p *next; int x;};int main(){ struct p *p1 = (struct p*)malloc(sizeof(struct p)); p1->x = 1; p1->next = (struct p*)malloc(sizeof(struct p)); return 0;}
#include<stdio.h>void main(){ int *ptr, a=10; ptr = &a; *ptr += 1; printf("%d, %d", *ptr, a);}
class SalaryCalculationException extends Exception{}class Person{ public void calculateSalary() throws SalaryCalculationException{ //... throw new SalaryCalculationException(); //... }}class Company{ public void paySalaries(){ new Person().calculateSalary(); }}
#include <stdio.h>int main(){ char *str = "This" //Line 1 char *ptr = "Program\n"; //Line 2 str = ptr; //Line 3 printf("%s, %s\n", str, ptr); //Line 4}