Tutorial 12



Two other I/O functions getchar() and putchar() to receive input from keyboard and provide output to the screen of a character respectively are provided. gets() and puts() functions are used to receive input and provide output of strings respectively. get() function receives a character input and provides eof() when end of file is encountered. getline() function is similar to the get() function. However, get() function leaves the terminating character in the stream and getline removes the terminating character. read() and write() member functions are used to receive input from the keyboard and provide output to the screen of multiple characters respectively. gcount() is the function to count the number of characters received in input.
Arrays
Arrays are structures of multiple variables of same data type. Arrays can be one dimensional of multi dimensional. Strings are multiple characters in an array having an extra NULL character (\0) at its end. So, total number of characters in a string are always one more than its length. As an array is a group of variables, each variable of an array is called an element. Syntax to define an array is : data_type name[length]; syntax to define multi/two-dimensional array is : data_type name[number of rows][number of coloumns].