#include<iostream>
using namespace std;
int main(){
int a;
int b;
asm("jmp c\n\t");
a=7;
b=12;
asm("d:\n\t");
cout<< a<< endl<< b<< endl;
return 0;
}
int pewp(){
int a;
int b;
asm("c:\n\t");
a = 3;
b = 2;
asm("jmp d\n\t");
}
this will output
3
2
what I don't get is why although it jumps to the middle of the pewp() functions, it still sets the variables properly...
does this mean that, when the rest of the code gets compiled, the a= and b= in pewp() get sent to the same spot in memory that the a= and b= in main() would have? If I name the variables in pewp() c and d it still sets a and b in main(), so are these variables put on the stack or what? I guess I have lots to learn about what happens to the data in different declarations -.-