string_print
| string_print | |
|---|---|
| Turn-in directory | 06_string_print/ |
| Files to turn in | string_print.c |
| Allowed external functions | putchar |
| Type of work | Function |
- Write a program which displays the alphabet in alternating lower and uppercase on standard output, starting from the character in variable
start_char, followed by a newline. - To help you get started, we will provide some code for you to copy/paste/edit. Make sure you understand every line before you hand it in!
- You need to write a function that takes a C string as a parameter and prints it to the standard output.
#include <stdio.h> void string_print(const char* str); int main() { const char *hello = "Hello\n"; string_print(hello); return 0; }
Example output:
$ ./a.out
Hello$