logoISU  

CS256 - Principles of Structured Design

Fall 2021

Displaying ./code/cs256su21code/jun14/arrays3.c

/*

defining a character array , we've seen this kind of thing before

*/

#include <stdio.h>

#define SIZE 100 

int main(){

	char str[SIZE];

	printf("Enter a string: ");
	fgets(str, SIZE, stdin);

	printf("%s", str);

	printf("%c\n", str[7]); //printing a single character from the array,
							//use %c with printf to print a single character
	return 0; 


}