Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errore esercizi analisi codice #24

Open
frankpolimi opened this issue Nov 23, 2013 · 0 comments
Open

errore esercizi analisi codice #24

frankpolimi opened this issue Nov 23, 2013 · 0 comments

Comments

@frankpolimi
Copy link
Contributor

in questo codice credo ci siano errori alla riga 12 e 20.
inserisco le modifiche in un commento a lato.

include <stdio.h>

include <stdlib.h>

int main()
{
int *a;
int n,i;

printf ("quanti numeri interi vuoi che memorizzi?");
scanf("%i",&n);

a=malloc(n*sizeof(int)); // a=(int *)malloc(n*sizeof(int));

for (i=0;i<n;i++)
    a[i]=i;

for (i=0;i<n;i++)
    printf ("%i\n",a[i]);

free(p); //free(a);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant