Skip to content

Instantly share code, notes, and snippets.

@MaratB
Created October 13, 2013 13:22
Show Gist options
  • Save MaratB/6962321 to your computer and use it in GitHub Desktop.
Save MaratB/6962321 to your computer and use it in GitHub Desktop.
#include <conio.h>
#include <stdio.h>
#include <string.h>
main(){
char s[80];
int i=0;
printf("Введите имя файла: \n");
gets(s);
while ((s[i] != '.') &&(s[i] !='\0')) // ищем точку или конец строки
i++;
if (s[i] == '.')
strcpy(s+i, ".exe"); // меняем расширение
else
strcat(s,".exe"); //добавляем
puts(s);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment