Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. //main.c
  2. #include <stdlib.h>
  3. #include <gtk/gtk.h>
  4. #include "g-carro.h"
  5.  
  6.  
  7.  
  8. int main (int argc, char *argv[])
  9. {
  10.   g_type_init();
  11.   GCarro *carro1, *carro2;
  12.  
  13.   carro1 = g_object_new(G_TYPE_CARRO, NULL);
  14.   carro2 = g_object_new(G_TYPE_CARRO, NULL);
  15.  
  16.   g_print("\n= Manipulando o objeto: carro1 =\n");
  17.   g_carro_ligar(carro1);
  18.   g_carro_acelerar(carro1, 40);
  19.   g_carro_reduzir(carro1, 20);
  20.   g_carro_desligar(carro1);
  21.  
  22.   g_print("\n= Manipulando o objeto: carro2 =\n");
  23.  
  24.   g_carro_acelerar(carro2, 40);
  25.   g_carro_ligar(carro2);
  26.   g_carro_acelerar(carro2,20);
  27.   g_carro_reduzir(carro2, 20);
  28.   g_carro_desligar(carro2);
  29.  
  30.   g_print("\nLiberando memória...\n");
  31.   g_object_unref(carro1);
  32.   g_object_unref(carro2);
  33.   return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement