ТК
Тоня Казакова

Помогите найти ошибку в коде на Си

Вот код

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

#include
#include
#include
#include
#include
#include

void main(){
int j,i=0,n;
char temp=NULL,buffer=NULL;
char* kluch;
FILE *inp, *out;
int vybir;

while (vybir!=5){
clrscr();

printf("1.To code\n2.To decode\n3.Help\n4.About\n5.Exit\nYour choice->");
scanf("%d",&vybir);
clrscr();
if (vybir==1) {
inp = fopen("Input.txt" , "r");
out = fopen("Output.txt" , "w");
if(inp==NULL){
printf("Is not found Input.txt");
getch();
exit(1);
}
printf("Enter the key (without blanks)-> ");
scanf("%s", kluch);
n=strlen(kluch);
while(inp!= EOF)
{

fread((char*)&buffer,sizeof(buffer), 1, inp);
if(buffer==NULL) break;

j=fmod(i,n);
temp=buffer^kluch[j];

fwrite((char*)&temp,sizeof(temp), 1, out);
i++;
buffer=NULL;
}
fclose(inp);
fclose(out);
printf("The coded text saves in the file ");
getch();
exit(1);
}
if (vybir==2) {
inp = fopen("Output.txt" , "r");
out = fopen("Desifr.txt" , "w");
if(inp==NULL)
{
printf("Is not found Output.txt");
getch();
exit(1);
}
printf("Enter the key (without blanks)-> ");
scanf("%s", kluch);
n=strlen(kluch);
while(inp!= EOF)
{

fread((char*)&buffer,sizeof(buffer), 1, inp);
if(buffer==NULL) break;

j=fmod(i,n);
temp=buffer^kluch[j];
fwrite((char*)&temp,sizeof(temp), 1, out);
i++;
buffer=NULL;
}
fclose(inp);
fclose(out);
printf("The decoded text saves in the file ");
getch();
exit(1);}

if (vybir==3) {printf("\nFor coding:\n 1 - bring the text in the file .\n 2 - pass to the point of .\n 3 - enter the key.\n 4 - the coded text saved in the file ");
printf("\nFor decoding:\n 1 - bring the coded text in the file .\n 2 - pass to the point of .\n 3 - enter the key.\n 4 - the decoded text saved in the file "); getch(); }
if (vybir==4) {printf("\n\n\n\n\t\t\tThe program of coding and decoding is written by\n\n\t\t\t\t Students CS-1201: \n\n\t\t\t\t Kinash O.M\n\t\t\t\t Pryhodko V.M\n\t\t\t\t Pliska L.D\n\n\n\t\t\t\t\t 2013"); getch(); }
}

clrscr();
printf("\nGood Luck!!!\nPress any key...");
getch();}

не понимаю в чем ошибка, может в бибилотекках, раньше работало, сейчас ошибка, как изменить?

Stasnislav Haustov
Stasnislav Haustov

Убери цифрочки в начале программы.
И мы не телепаты и увидеть твою ошибку "нет места на жестком диске" увидеть не можем. Вопросы по коду должны содержать:
1. Условие
2. Код (причем в читабельном виде, потрудись выровнять и выложить на pastebin.com
3. Конкретное описание ошибки (не "теперь ошибка", а чего ты ожидаешь и что получаешь, если сообщение об ошибке - приведи полный текст сообщения) .
Также желательно указать, что было раньше, а что сейчас, если появление ошибки связанно с этим.

Похожие вопросы
Помогите найти ошибку в коде
Помогите найти ошибку в коде программы!
Подскажите где ошибка в коде на с (си)
Помогите найти ошибку в коде!
помогите найти ошибку в коде с++
перевод кода из паскаля на Си не найти ошибку.
Помогите найти ошибку в 5 строчках кода на Си
найдите ошибки в коде, язык си
Найти ошибки в коде. Язык си
Помогите найти ошибку в коде.