0
/* [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
*/
This is giving the compiler these errors. I think I have declared wrong something or I have not yet understood right to dynamic allocation someone can 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;
}
bigown Show me some website or book so I can study , I want to learn a lot about it and master this subject, so I can help the community and my classmates.
– ALFAEX
Take a look here: http://answall.com/tags/c/info. Now you can vote on everything on the site, not just the things you asked. You can learn from here: http://answall.com/questions/tagged/c?sort=votes&pageSize=50
– Maniero