Quantcast
Channel: User Marco A. - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Answer by Marco A. for Can a Macro with a goto statement and a label be defined?

$
0
0

A macro is a textual substitution taken care by the preprocessor so, yes you can. You can define a macro for a goto statement and/or a label.

Ps. anyway that's a terrible practice.. both using lots of macros and using gotos

#include <iostream>#define GOTOSTMT goto helloworld;#define LABELSTMT helloworld:int main() {    int i = 0;    LABELSTMT    std::cout << "Don't ever program like this" << std::endl;    i++;    if(i < 3)        GOTOSTMT}

Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>