Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //file ClassNumero.h
- truct ClassNumero{
- int x; //il numero che verrà salvato
- void (*times)(int x);
- };
- void time(int x){
- int i;
- for( i = 0; i< x; i++){
- printf("vi voglio bene!\n");
- }
- }
- //file main
- #include <stdio.h>
- #include <stdlib.h>
- #include "ClassNumero.h"
- int main(int argc, char*argv[]){
- struct ClassNumero numero;
- char c = *argv[1];
- printf("%c %d\n", *argv[1], c);
- numero.x = c - 48;
- printf("%d\n",numero.x);
- numero.times = time;
- (*numero.times)(numero.x);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement