The second question...

I remembered what the second exam question was: define a
struct Element
to hold single elements from the periodic table, including:
  • an int for the atomic number,
  • a string for the element's name, and
  • an array of 7 ints to hold the number of electrons in each shell
Then write a function
void getElement(Element \*element)
to get the information. Fairly simple really as long as you document any assumptions, make sure you include at least _some_ error checking, remember to typedef the struct and remember that since the routine is a void... we're hurtling into pointers. Of course talking about this question afterwards, a lot of my peers indicated that they had trouble handling the pointer aspects of the question: they couldn't get a handle on it. (Terrible geek joke, sorry!) Now I wonder whether the examiner will understand my use of the /\* ARGSUSED \*/ marker.....
Comments:

Post a Comment:
Comments are closed for this entry.
About

I work at Oracle in the Solaris group. The opinions expressed here are entirely my own, and neither Oracle nor any other party necessarily agrees with them.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today