what compiler that change all variable in one occurrence?
what compiler that change all variable in one occurrence?
Could you clarify what you mean by changing all variables "in one occurence"? For example, if x, y and z are integers, you can write the following in legal C. It doesn't matter what compiler you use.
Code:x = y = z = 0;
Example
If I change the variable x to y in line 4. It automatically change the variable x in line 5 and 6 to y.Code:#include<stdio.h> void main() { int x; scanf("%d", &x); printf("%d", x); }
They all will - but there is a box to check, marked "whole word only", and another one to enable a change of ALL the target values throughout the program.
And finally, there is an option for the direction you want the search to be done in, and whether it will "wrap" back around to the current location, or not, when taking this action.
So check your options.
This function is called "Replace..." or "Find and Replace..." and is available in most text editors. Each one does it a little bit differently. For example in CodeBlocks there is the option to do the replacement on all open files, which is nice. And you should also "Match case" as well as "whole word only" because C is case-sensitive. If you want to rename x to y, then you wouldn't want to inadvertently rename X to y
> what compiler that change all variable in one occurrence?
As c99tutorial says, this is a function of your code editor, not your compiler.
A compiler just READS your source text file, and translates it through a number of steps into some kind of executable program.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.