`random' undeclared (first use this function) - C (СИ)
Формулировка задачи:
Проблемы в простом коде, а именно:
Выдаёт ошибку : `random' undeclared (first use this function). Всё согласно учебнику написано было.N; i++)
A[i]=A[i]*2;
printf(
На выдаёт ошибку:
`fpintf' undeclared (first use this function)
# include <stdio.h>
# include <stdlib.h>
# include <conio.h>
const int N=10;
main () {
int i, A[N];
for (i=0; i<N; i++)
A[i]=random(26)-10;
printf("The first massive is: ");
for (i=0; i<N; i++)
printf("%d", A[i]);
for (i=0; i<N; i++)
A[i]=A[i]*2;
printf("The result is: ");
for (i=0; i<N; i++)
printf ("%d", A[i]);
getch();
}
Вот из той-же оперы ошибка:
# include <stdio.h>
# include <conio.h>
const int N=10;
main(){
int i, A[N];
FILE *fp;
fp = fopen("D:\\input.dat", "r");
if (fp==NULL) {
printf("No file");
return 1;
}
for (i=0; i<N; i++)
if (0== fscanf(fp,"%d", &A[i])) {
printf ("Not enought data!!");
break;
}
fclose (fp);
for (i=0; i<N; i++)
A[i] = A[i]*2;
fp = fopen ("output.dat", "w");
for (i=0; i<N; i++)
fpintf(fp, "%d\n", A[i]);
fclose(fp);
}fpintf(fp, "%d\n", A[i]);
Решение задачи: «`random' undeclared (first use this function)»
textual
Листинг программы
(struct node *) malloc