Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- int main(int argc, char *argv[])
- {
- int i;
- int f;
- int diag;
- float *Pi;
- typedef struct A{
- char imie [25];
- char kolor[20];
- int dlugosc;
- } kot;
- kot longcat = {{'\0'}, {'\0'}, 20};
- sprintf(longcat.kolor, "%s", "bialy");
- printf("%s",longcat.kolor);
- srand(time(0));
- if(argc>1)
- diag = sscanf(argv[1], "%d", &f);
- else
- return -1;
- //printf("%d\n", f);
- //printf("diag %d\n", diag);
- Pi = (float *)malloc(sizeof(float)*f);
- for(i=0; i<f;i++)
- Pi[i]=rand()%100;
- for(i=0; i<f; i++)
- printf("%f\t", Pi[i]);
- free(Pi);
- system("pause");
- return 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement