Skip to content

Instantly share code, notes, and snippets.

@ShivamShrirao
Last active April 7, 2018 09:48
Show Gist options
  • Save ShivamShrirao/3888e7f52b2e1328f534a6d907ac4c63 to your computer and use it in GitHub Desktop.
Save ShivamShrirao/3888e7f52b2e1328f534a6d907ac4c63 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<unistd.h>
#include<string.h>
int main()
{
char buf[100];
printf("Enter input: ");
read(0,buf,250); //read 250 bytes from stdin (0) to buf
printf("Input was : %s\n",buf);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment