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?
- std::string to char*
- How to convert an int to string in C?
- How to convert a char to a String?
- How to convert/parse from String to char in java?
- What is a string of hexadecimal digits?
- Conversion from string to char – c++
- How to convert an int to string in C?
- How to convert a string to integer in C?
- What is an unsigned char?
- Get a substring of a char* [duplicate]
- char *array and char array[]
- How do I create an array of strings in C?
- Get a substring of a char*
- How to convert a char array to a string?
- Expression must be a modifiable L-value
- C: correct usage of strtok_r
- “error: assignment to expression with array type error” when I assign a struct field (C)
- What is use of c_str function In c++
- How do I properly compare strings in C?
- How to remove .html from URL?
- How do I properly compare strings in C?
- How to convert an int to string in C?
- std::string to char*
- How to convert an int to string in C?
- How to convert a std::string to const char* or char*
- What does strcmp() exactly return in C?
- Returning string from C function
- Illegal Escape Character “\”
- How do I create an array of strings in C?
- Char Comparison in C
- How to check if a string is a number?
- How do I apply the for-each loop to every character in a String?
- C – The %x format specifier
- How can I convert const char* to string and then back to char*?
- How to convert integer to string in C?
- Convert char* to string C++
- 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?
- How do I concatenate const/literal strings in C?
- Reversing a string in C
- How to remove the character at a given index from a string in C?
- Excess elements in char array initializer error
- waitpid, wnohang, wuntraced. How do I use these
- Split string with delimiters in C
- How to initialize array to 0 in C?
- Sign extend a nine-bit number in C
- Warning: assignment from incompatible pointer type
- 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: error: expected ‘)’ before ‘;’ token
- Where is the C auto keyword used?
- make: Nothing to be done for `all’
- C char* to int conversion
- execv vs execvp, why just one of them require the exact file’s path?
- difference between
and - expected expression before ‘{‘ token
- C# – How to convert string to char?
- Setting std=c99 flag in GCC
- C Vector/ArrayList/LinkedList
- Bind failed: Address already in use
- Warning/error “function declaration isn’t a prototype”
- What is the difference between %f and %lf in C?
- warning: initializer element is not computable at load time
- What is stdin in C language?
- How to prevent multiple definitions in C?
- How to pass 2D array (matrix) in a function in C?
- error: ‘for’ loop initial declarations are only allowed in C99 mode [duplicate]
- How can you print multiple variables inside a string using printf?
- c – warning: implicit declaration of function ‘printf’
- Flushing buffers in C
- What are 0x01 and 0x80 representative of in C bitwise operations?
- How to make parent wait for all child processes to finish?