/* [Error] expected primary-expression before'*' token
[Error] 'dia' was not declared in this scope
[Error] 'mes' was not declared in this scope
[Error] 'ano' was not declared in this scope
*/
You are giving these compiler errors. I think I said something wrong or I still did not understand the right allocation dynamics can anybody help me
#include<stdio.h>
#include<stdlib.h>
int main ()
{
struct calendario
{
int dia;
int mes;
int ano;
};
struct calendario x,*ptr;
ptr= malloc(calendario * sizeof(int));
ptr->dia = 5;
ptr->mes=10;
ptr->ano=1990;
printf("%i",dia);
printf("%i", mes);
printf("%i",ano);
system("pause>null");
return 0;
}