Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
 
int main() {
 
int fd_to_read=open("sometext.txt",O_RDONLY);
int fd_to_write=open("newtext2.txt",O_WRONLY | O_CREAT , S_IRUSR |S_IWUSR);
 
	if(fd_to_read==-1 || fd_to_write=-1){
		printf("Le fichier ne peut s'ouvrir \n");
		return -1;}
	char c;
	int bytes;
	while((bytes=read(fd_to_read,&c,sizeof(c)))>0){
		if(c=='.'){
			c='!';}
write(fd_to_write,&c,sizeof(c));
 
}
close(fd_to_read);
close(fd_to_write);
 
}
Bonsoir quelqu'un pourrait me dire comment je pourrais compiler ce genre de programme ( je sais que c'est un langage de bas niveau ) merci d'avance pour votre aide .