Is there something like Pascal "with" keyword in C++?
I used it in Pascal this way:
type Tstructure = record {equals to typedef struct in C++}
element1: boolean;
element2: integer; {and so on}
end;
var structure: Tstructure;
procedure viewelements(); {prints contents of the two elements}
begin
if structure.element1 then writeln('true') else writeln('false');
writeln(inttostr(structure.element2));
end;
procedure viewelementsUsingWith(); {prints contents of the two elements using with keyword}
begin
with structure do begin
if element1 then writeln('true') else writeln('false');
writeln(inttostr(element2));
end;
end;
end.
If you don't know Pascal (but I think everybody here does), I NEED TO ACCESS STRUCTURE ELEMENTS WITHOUT ALWAYS WRITING A STRUCTURE NAME BEFORE "." or "->"
Please excuse my POOR english...