-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.c
84 lines (79 loc) · 1.95 KB
/
demo.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
// demo.c
// todoc_app
//
// Created by Wesley Jesus on 08/09/24.
//
//#include <stdio.h>
//#include <gtk/gtk.h>
//
//struct Person {
// char name[50];
// int age;
//};
//
//// O typedef define um novo tipo chamado Customer, entao nao precisa escrever struct ao declarar a variavel.
//typedef struct {
// char name[50];
// int age;
//} Customer;
//
//static void
//print_hello (GtkWidget *widget,
// gpointer data)
//{
// g_print ("Hello World\n");
//}
//
//static void
//activate (GtkApplication *app,
// gpointer user_data)
//{
// GtkWidget *window;
// GtkWidget *button;
//
// window = gtk_application_window_new (app);
// gtk_window_set_title (GTK_WINDOW (window), "Hello");
// gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
//
// button = gtk_button_new_with_label ("Hello World");
// gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
// gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
//
// g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
// gtk_window_set_child (GTK_WINDOW (window), button);
//
// gtk_window_present (GTK_WINDOW (window));
//}
//int
//main (int argc,
// char **argv)
//{
// GtkApplication *app;
// int status;
//
// app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
// g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
// status = g_application_run (G_APPLICATION (app), argc, argv);
// g_object_unref (app);
//
// return status;
//}
// struct Person person1;
//
// printf("input the name: ");
// scanf("%s", person1.name);
//
// printf("input the age: ");
// scanf("%d", &person1.age);
//
// printf("\nName: %s\nAge: %d\n", person1.name, person1.age);
// Customer customer = { "Wesley", 31 };
//
// int *ptr = &customer.age;
//
// printf("\nName: %s\nAge: %d\n", customer.name, customer.age);
//
// printf("Endereço armazenado em ptr: %p\n", (void*)ptr);
//
// return 0;