To answer the question without reading too much else into it i would
char str[2] = "\0"; /* gives {\0, \0} */ str[0] = fgetc(fp);
You could use the second line in a loop with what ever other string operations you want to keep using char’s as strings.
Related Posts:
- How do I check if a string contains a certain character?
- What is the difference between char s[] and char *s?
- Return char[]/string from a function [duplicate]
- Return char[]/string from a function
- How to do scanf for single char in C
- Data argument not used by format strings in C
- Convert char array to a int number in C
- Returning an array using C
- How to copy a char array in C?
- Simple way to check if a string contains another string in C?
- How to empty a char array?
- Proper way to empty a C-String
- How do you allow spaces to be entered using scanf?
- Does C have a string type?
- Tokenizing strings in C
- The difference between char * and char[] [duplicate]
- How to format strings using printf() to get equal length in the output
- How to format strings using printf() to get equal length in the output
- realloc(): invalid next size when reallocating to make space for strcat on char *
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- Split string with multiple delimiters using strtok in C
- Pointer to a string in C?
- Convert long long to string in C?
- How does strtok() split the string into tokens in C?
- How to convert an int to string in C?
- How to convert a char to a String?
- What is an unsigned char?
- char *array and char array[]
- Get a substring of a char*
- How to convert a char array to a string?
- C: correct usage of strtok_r
- How to remove .html from URL?
- How to convert an int to string in C?
- How to convert a std::string to const char* or char*
- How do I create an array of strings in C?
- How to check if a string is a number?
- How do I lowercase a string in C?
- How do I create an array of strings in C?
- How to print a char array in C through printf?
- How to clear all the elements of array in C?
- Excess elements in char array initializer error
- Sign extend a nine-bit number in C
- Break statement not within loop or switch in C
- How to properly malloc for array of struct in C
- How to create an array of strings in C?
- Cache Simulator in C
- C char* to int conversion
- expected expression before ‘{‘ token
- C# – How to convert string to char?
- C Vector/ArrayList/LinkedList
- Bind failed: Address already in use
- What is the difference between %f and %lf in C?
- What is stdin in C language?
- How to pass 2D array (matrix) in a function in C?
- How to compile makefile using MinGW?
- Portable way to check if directory exists [Windows/Linux, C]
- Allocating string with malloc
- too many arguments for format [-Wformat-extra-args]
- cast to pointer from integer of different size, pthread code
- How to convert integer to char in C?
- Where to find the complete definition of off_t type?
- struct has no member named
- printf not printing to screen
- Initializing array of structures
- Still Reachable Leak detected by Valgrind
- What is the difference between array and enum in C ?
- What is signed integer overflow?
- When to use const char * and when to use const char []
- What do numbers using 0x notation mean?
- Can I create an Array of Char pointers in C?
- Does stack grow upward or downward?
- Convert Little Endian to Big Endian
- error C2371: ‘functionname’ redefinition: different basic types
- How to write to a file using open() and printf()?
- note: previous implicit declaration of ‘point_forward’ was here
- What exactly is meant by “de-referencing a NULL pointer”?
- Array type char[] is not assignable
- getc() vs fgetc() – What are the major differences?
- Can’t understand the working of getint() in C as per K&R
- How to remove first character from C-string?
- C char array initialization
- Standard function to replace character or substring in a char array?
- char array not assignable
- In C, what exactly happens when you pass a NULL pointer to strcmp()?
- Why and when to use static structures in C programming?
- Where does linux store my syslog?
- Example of waitpid() in use?
- Can a function return two values?
- How to know what the ‘errno’ means?
- Printf was not declared in this scope
- warning: missing terminating ” character [enabled by default]
- How to free memory from char array in C
- Can I get Unix’s pthread.h to compile in Windows?
- Initializing 2D char array in C
- FFT in a single C-file
- Process exited with return value 3221225477
- malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))
- %p Format specifier in c
- “Nothing to be done for makefile” message
- What is the difference between signed and unsigned int