Why scope resolution operator works in TurboC but doesn't work in Codeblocks in C program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why scope resolution operator works in TurboC but doesn't work in Codeblocks in C program?

I tried the following code which is an example of shadowing process in both the IDE's. But it works fine in TurboC but it doesn't work in Codeblocks. int i=1; int main() { int i=2; { int i=3; printf("%d", ::i); } return 0; } This is a C program. It has been saved using .c extension.

13th Nov 2017, 5:12 AM
Shashank Shekhar
Shashank Shekhar - avatar
1 Answer
+ 22
maybe because it is a c++ feature? https://stackoverflow.com/questions/28300252/is-there-a-scope-resolution-operator-in-c-language Is there a scope resolution operator in C language? - Stack Overflow https://www.quora.com/What-is-the-syntax-use-scope-resolution-operator-in-C-language-in-code-block-compiler What is the syntax use scope resolution operator in C language in ... do yourself a favor avoid turbo c.. https://www.sololearn.com/discuss/288609/?ref=app Why to avoid Turbo C++ (TCC)? | SoloLearn: Learn to code for FREE!
13th Nov 2017, 5:16 AM
Lord Krishna
Lord Krishna - avatar