Created
July 11, 2022 03:34
-
-
Save diogojorgebasso/58f7d73f8b19e41095f6f96a4b28cb92 to your computer and use it in GitHub Desktop.
Struct com ponteiros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef struct{ | |
char titulo[30], producao[20], dataCompra[8]; | |
int temporada; | |
float preco; | |
}t_serietv; | |
int main(int argc, char *argv[]){ | |
t_serietv *s1; | |
s1 = (t_serietv*) malloc(sizeof(t_serietv)); | |
strcpy(s1->titulo,"Big Bang Theory"); | |
s1->temporada = 3; | |
printf("%s esta na temporada %d \n",s1->titulo,s1->temporada);13 | |
free(s1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment