/*
ProgEx22 -- (program should run as C or C++)
Simple program shows how to read a line of keyboard input into an 256 byte
buffer. Just enter a line of text and press [ENTER]. Its equivalent to the
following PowerBASIC Console program...
#Compile Exe
#Dim All
Function PBMain() As Long
Local szBuffer As Asciiz*256
Line Input szBuffer
Print szBuffer
Waitkey$
PBMain=0
End Function
You need to be careful to make the buffer into which you want the text line
read to be big enough.
*/
#include <stdio.h>
#define MY_SIZE 256
int main(void)
{
char szBuffer[MY_SIZE];
gets(szBuffer);
puts(szBuffer);
getchar();
return 0;
}
/* --Output--
==============
Some Line Of Text I Entered!
*/