#define torsk break
but I also wonder why would you want such weird thing...
質問
Is is possible to redefine 'break' in such a way that I can just write 'torsk' instead? E.g:
switch (chocolateistasty) {
case true: {
cout << "It is!" << endl;
torsk;
}
case false: {
cout << "Nope." << endl;
torsk;
}
}
I imagine this would be done with some preprocessor commands.
解決
#define torsk break
but I also wonder why would you want such weird thing...
他のヒント
Yes you can do it with preprocessor
#define torsk break
you can do anything you want like
#define forever for(;;)