Format string specifiers for printf
use %
to denote the start of a format specifier, not &
.
void displayPuzzle() { int i, j; char x = 'A'; for (i = 0; i < COLOUMNS; i ++) { printf("%c ", x); x++; } printf("\n\n"); for (i = 0; i < ROWS; i ++) { printf("%d\t", i); for (j = 0; j < COLOUMNS; j ++) { printf("%c ", puzzle[i][j]); } printf("\n\n"); } }
Related Posts:
- How do you allow spaces to be entered using scanf?
- 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
- How can you print multiple variables inside a string using printf?
- Simple way to check if a string contains another string in C?
- Is there a way to have printf() properly print out an array (of floats, say)?
- Proper way to empty a C-String
- How to write to a file using open() and printf()?
- Does C have a string type?
- Tokenizing strings in C
- What do \t and \b do?
- realloc(): invalid next size when reallocating to make space for strcat on char *
- write() to stdout and printf output not interleaved?
- Split string with multiple delimiters using strtok in C
- Pointer to a string in C?
- Convert long long to string in C?
- How do I check if a string contains a certain character?
- Convert Char to String in C
- How many spaces for tab character(\t)?
- How does strtok() split the string into tokens in C?
- How to convert an int to string in C?
- What is a string of hexadecimal digits?
- How to convert an int to string in C?
- Correct format specifier for double in printf
- Scanf/Printf double variable C
- How to convert a string to integer in C?
- How do I create an array of strings in C?
- Strings and character with printf
- What is the difference between char s[] and char *s?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- printf() formatting for hexadecimal
- Printing hexadecimal characters in C
- What is use of c_str function In c++
- What is the argument for printf that formats a long?
- 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?
- What is the printf format specifier for bool?
- How to convert an int to string in C?
- What does strcmp() exactly return in C?
- Returning string from C function
- How to printf “unsigned long” in C?
- How I can print to stderr in C?
- How do I create an array of strings in C?
- Return char[]/string from a function [duplicate]
- How to check if a string is a number?
- Is there a printf converter to print in binary format?
- C – The %x format specifier
- How to convert integer to string in C?
- How do I lowercase a string in C?
- How do I create an array of strings in C?
- printf with std::string?
- What does “%.*s” mean in printf?
- Return char[]/string from a function
- 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?
- waitpid, wnohang, wuntraced. How do I use these
- Split string with delimiters in C
- How to initialize array to 0 in C?
- How to do scanf for single char 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’
- How to printf a memory address in C
- execv vs execvp, why just one of them require the exact file’s path?
- difference between
and - expected expression before ‘{‘ token
- How can one print a size_t variable portably using the printf family?
- Setting std=c99 flag in GCC
- C Vector/ArrayList/LinkedList
- Convert char array to a int number in C
- Bind failed: Address already in use
- Warning/error “function declaration isn’t a prototype”
- What is the difference between %f and %lf in C?
- Returning an array using C
- %i or %d to print integer in C using printf()?
- 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]
- 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?
- error: aggregate value used where an integer was expected
- Undefined Reference issues using Semaphores
- What is time(NULL) in C?
- Use of cudamalloc(). Why the double pointer?
- C dynamically growing array