Q:

Usage of malloc with many structs in c

I try to store many things with my struct.  The variables seem to be stored within the "do-while", but when I try to access an element stored after the do-while, the element is gone. 
What did I do wrong? 
#include <stdio.h>
#include <stdlib.h>

struct Sauto {
int part;

};

int main() {
int i=0;
struct Sauto *car;

do {
    car = malloc(sizeof(struct Sauto)+(sizeof(struct Sauto)*i));
    struct Sauto car[i];

    printf("part%i:", i);
    scanf("%i", &car[i].part);
    printf("part%i is %i\n", i, car[i].part);
    i++;
} while (i<3);
printf("part 0 is %i\n", car[0].part);
return 0;
}

A:

You redeclared a variable with the same name "car".  Delete the declaration in the do-while loop.