Voting results

#1. Question about different presentations of pointers in program

For example see code fragment, which build syntax tree for function. On C language it can be written as:

(1) word *P=&Dict[pFunc].pNode; (2) while (strcmp(Buff,"end")!=0) (-) { (3) *P= Ctrl(Buff); (4) P=&Node[*P].pRight; (-) }

On Context language:

(1) word @P=@Dict[pFunc].pNode; (2) while strcmp(@Buff,"end")!=0 do (3) P= Ctrl(@Buff); (4) @P=@Node[P].pRight; (5) end

In both fragments the assignment operators of value and address in lines 3 and 4 are written consciously with different indents. Other forms of writing of this actions also possible. What form of pointer definition and address assignment (lines 1 and 4) is presented for You as most comprehensible:

(A) word *P =&Dict[pFunc].pNode; (B) word @P =@Dict[pFunc].pNode; (C) word P^=@Dict[pFunc].pNode; (D) word P^= Dict[pFunc].pNode^;

Here Dict - array of struct, field pNode - word, @ - prefix, ^ - postfix address calculation operator.

Other allowes answers

(E) another form (F) not know

Results:

Choice Count %
A 56 48%
B 20 17%
C 9 8%
D 11 9%
E 13 11%
F 8 7%
Total: 117 100%

Since 02.12.2002 to 31.12.2004 about 1.5 percent of visitors are answers to this question.

#2. Question about control structures

In some programming languages ( C/C++/... ) operator brackets ( {..} / begin...end ) are used. To place more than one operator into control structure ( if / while / ... ) Yuo must use brackets. In other languages ( Modula/Basic/... ) any number of operators may be placed into control structure without brackets. In Pascal both variants are used ( while vs repeat/until ). If no brackets defined special keywords are used to close control structure ( end / endif / enddo / ... ). For example

while (Buff[I]!=0) // A - with brackets { if (Buff[I]=='\\') { K=I+1; } I++; } while Buff[I]!=#0 do // B - with common close keyword ( end ) if Buff[I]='\' then K=I+1; end inc I; end while Buff[I]!=#0 do // C - with different close keywords ( endif / enddo / ... ) if Buff[I]='\' then K=I+1; endif inc I; enddo while Buff[I]!=#0 do // D - with different close keyword pairs ( end if / end do / ... ) if Buff[I]='\' then K=I+1; end if inc I; end do

What form of control structures is presented for You as most suitable:

(A) Brackets (B) Common keyword (C) Different keywords (D) Different keyword pairs

Other allowes answers

(E) another form (F) not know

Results:

Choice Count %
A 51 59%
B 15 17
C 7 8%
D 10 11%
E 4 5%
F 0 0%
Total: 87 100%

Since 03.03.2003 to 31.12.2004.



Π‘Π°ΠΉΡ‚ создан Π² систСмС uCoz