kaptnole, . :
^ [\ s\] * ([A-Za-Z_0-9]) [\ s\] = [\ s\]\1 [\ s\]; [\ s\] * $
, :
http://msdn.microsoft.com/en-us/library/2k3te2cs%28VS.80%29.aspx
... ( Perl!).
perl :
perl -n -e'/^[\s\t]*([a-zA-Z_0-9]*)[\s\t]*=[\s\t]*\1[\s\t]*;[\s\t]*$/&&print "$. $_"' test_me && echo
, , :
hi = hi;
hi= hi ;
hi=hi ;
....
xxxxx@yyyy% perl -n -e'/[\s\t]*([a-zA-Z_0-9]*)[\s\t]*=[\s\t]*\1[\s\t]*;[\s\t]*$/&&print "$. $_"' test_me && echo
1 hi = hi;
2 hi= hi ;
3 hi=hi ;
xxxxx@yyyy%
, Awk, , , Awk !: (
, Perl script ... !
1
, main "-pedantic" "-Wall" gcc g++ ... .
:
int main (int argc, char *argv[]) {
int bob=5;
bob=bob;
return 0;
}
2
, perl script , . , ( ).
, "-Wshadow" gcc/g++ .
const . , , const
.
void hello_world_print_numbers(int number_1, int number_2, int number_3) {
...
}
- , , :
void hello_world_print_numbers(const int number_1, const int number_2, const int number_3) {
...
}
... , ( , !).
void hello_world_print_numbers(const int * number_1, const int * number_2, const int * number_3) {
...
}
3
^ . , my_class->name=name;. RC. . RC!