Creato esercizio con stringhe - nome e cognome

This commit is contained in:
2014-03-23 13:30:31 +01:00
parent 90715d7210
commit 9a4d3eb9db
7 changed files with 99 additions and 3 deletions

2
test/gino Executable file
View File

@@ -0,0 +1,2 @@
ehehifdgfdgdf
ehi

0
test/gino~ Executable file
View File

BIN
test/test

Binary file not shown.

View File

@@ -1,12 +1,25 @@
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
int main (int index, char** in_data){
char buf[50];
fscanf(stdin,"%10[^\n]",buf);
fprintf(stdout,"%s",buf);
int fd;
int data;
void * buf;
buf = malloc (100);
fd = open ("gino",O_WRONLY | O_APPEND,00700);
lseek (fd,2,SEEK_SET);
write (fd,(void *)"ehi",3);
close(fd);
return 0;