The output would be Raceca(R)acecar the middle r blinks |
could you elaborate further? |
' '
if(counter%2 == 0)
to print one version and else
to print the other. do that 100 times and break out of the loop, it will appear to be blinking. you might have to clear the console too so it appears it's in the same spot.
|
|
|
|
It's all there. make a copy. replace your middle letter with ' ' use if(counter%2 == 0) to print one version and else to print the other. do that 100 times and break out of the loop, it will appear to be blinking. you might have to clear the console too so it appears it's in the same spot. easy as pie |
how would i determine the middle letter of two words? |
NULL
and count how many times it isn't
|
|
check for NULL and count how many times it isn't |
strlen()
, and c++ strings maintain their own size()
.Chervil's solution would be more elegant than mine. how would i determine the middle letter of two words? check for NULL and count how many times it isn't 1 2 3 4 5 6 7 8 9
|
|
|
Here's my version of 'blinking the middle letter', of one word. The '\b' is backspace's to start the printing at the start of the last print.
|
and i also want to point out i cant use windows.h somehow. Did you make this on Turbo C++? |
however creating a variable for backspaces gives me an error. It says "Undefined symbol 'string' " |
string back(x, '\b');
uses the standard C++ string, and generates a string containing x occurrences of the character '\b'.