you need to iterate through the array’s elements
float foo[] = {1, 2, 3, 10}; int i; for (i=0;i < (sizeof (foo) /sizeof (foo[0]));i++) { printf("%lf\n",foo[i]); }
or create a function that returns stacked sn printf
and then prints it with
printf("%s\n",function_that_makes_pretty_output(foo))
Related Posts:
- Data argument not used by format strings in C
- How can you print multiple variables inside a string using printf?
- How do you allow spaces to be entered using scanf?
- How to write to a file using open() and printf()?
- 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
- What do \t and \b do?
- write() to stdout and printf output not interleaved?
- How many spaces for tab character(\t)?
- Correct format specifier for double in printf
- Scanf/Printf double variable C
- Strings and character with printf
- printf() formatting for hexadecimal
- Printing hexadecimal characters in C
- What is the printf format specifier for bool?
- How to printf “unsigned long” in C?
- How I can print to stderr in C?
- How to do scanf for single char in C
- Break statement not within loop or switch in C
- How to properly malloc for array of struct in C
- Cache Simulator in C
- Where is the C auto keyword used?
- How can one print a size_t variable portably using the printf family?
- 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?
- %i or %d to print integer in C using printf()?
- What is stdin in C language?
- How to prevent multiple definitions in C?
- How to pass 2D array (matrix) in a function in C?
- C dynamically growing array
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- How to compile makefile using MinGW?
- Mapping a numeric range onto another
- Why are hexadecimal numbers prefixed with 0x?
- too many arguments for format [-Wformat-extra-args]
- How to copy a char array in C?
- Simple way to check if a string contains another string in C?
- cast to pointer from integer of different size, pthread code
- Invalid type argument of unary ‘*’ (have ‘int’) Error in C
- Why do I get “cast from pointer to integer of different size” error?
- C subscripted value is neither array nor pointer nor vector when assigning an array element value
- error: too few arguments to function `printDay’ (C language)
- 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
- Assembly x86 – “leave” Instruction
- What is signed integer overflow?
- C’s printf and fprintf(stdout,) are not printing
- 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
- Excess elements of scalar initializer for pointer to array of ints
- error C2371: ‘functionname’ redefinition: different basic types
- How does one represent the empty char?
- Using floats with sprintf() in embedded C
- Printf width specifier to maintain precision of floating-point value
- note: previous implicit declaration of ‘point_forward’ was here
- Does C have a string type?
- Can I define a function inside a C structure?
- What exactly is meant by “de-referencing a NULL pointer”?
- getc() vs fgetc() – What are the major differences?
- Can’t understand the working of getint() in C as per K&R
- printf format specifiers for uint32_t and size_t
- How to repeat a char using printf?
- Tokenizing strings in C
- How to display hexadecimal numbers in C?
- Two decimal places using printf( )
- Realloc Invalid Pointer in C
- How do you format an unsigned long long int using printf?
- Reading float using scanf in c
- In C, what exactly happens when you pass a NULL pointer to strcmp()?
- Reading float using scanf in c
- “-bash: gcc: command not found” using cygwin when compiling c?
- 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?
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- How to know what the ‘errno’ means?
- Split string with multiple delimiters using strtok in C
- 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
- How do I check if a string contains a certain character?
- malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))
- %p Format specifier in c
- Level vs Edge Trigger Network Event Mechanisms
- “Nothing to be done for makefile” message
- Convert Char to String in C
- What is the difference between signed and unsigned int