Cross-Platform Coroutines in C++
By George Frasier, March 01, 2001
Coroutines are a natural solution to parsing problems used by assembly-language programmers. George presents a cross-platform coroutine technique for C++.
Mar01: Cross-Platform Coroutines in C++
void PrintRoutine::go()
{
int j;
while (true)
{
for (j = 0; j < k; j++)
cout << Word1[j];
resume(rspc);
for (j = k - 1; j >= 0; j--)
cout << Word1[j];
resume(rspc);
}
}
Example 6: Print5Routine prints the first word in order and the second word in reverse.