Last active
March 27, 2016 22:05
-
-
Save vfrico/235722951d57962fe091 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define MAXIMO 15 | |
int main(){ | |
int t, total; | |
char text[MAXIMO]; | |
total = 0; | |
printf("Introduce un texto: \n"); | |
while((t = read(0, &text, MAXIMO)) > 1){ | |
total = total + t; | |
write(1,&text,t); | |
} | |
printf("Tamaño: %d\n", total); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment