Question: How do I write a C function that outputs an arbitrary string by switching a variable between 2 and 1 ( in this case we
How do I write a C function that outputs an arbitrary string by switching a variable between 2 and 1 ( in this case we would be outputting in MORSE code, but don't mind with that, imagine you re making the right 2 to 1 and vice versa assignments of the "control variable". The method you choose must output any standard null-terminated string containing characters A-Z or 0-9 in Morse code, by switching the "control variable" between 2 and 1. For the demo, a child function, called from main( ) should output the string in Morse code, using a method that will work for any arbitrary string constant (in other words, main should pass the address of the null-terminated ASCII string to the child function)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
