Pseudocode - I'm confused

This is a discussion on Pseudocode - I'm confused within the C Programming forums, part of the General Programming Boards category; Basically the teacher wants us to write pseudocode for our whole program ( the shutter , aperture and ISO one ...

Pseudocode - I'm confused

Basically the teacher wants us to write pseudocode for our whole program ( the shutter , aperture and ISO one ) . The thing is , I have no idea how to do half of the things in pseudocode . For example strcomp() , strtol() ? Also how comprehensive does it need to be ? Let me give you an example :

Code:

fgets(guess ,10, stdin);
p = strchr(guess, '\n');
if ( p )
*p = 0;

The p = strchr(guess, '\n') has no real importance in the actual code , apart from to remove the effect of the new line character , so that fgets() works fine .
Would I have to include that in the pseudocode ? Thanks a lot for your help

As the name suggests, pseudocode generally does not actually obey the syntax rules of any particular language; there is no systematic standard form, although any particular writer will generally borrow the appearance of a particular language.

> Would I have to include that in the pseudocode ?
One way to think about it would be that the pseudo code would become the block comments in the code. So it tells you a little bit more of "why" you're doing something rather than just merely restating "how" you're doing some things.

The idea being you could just paste your pseudo code into an empty source file, go through it putting /**/ comments around each line, then start filling in the details with actual code.

The for loop I would replace with a pseudo code line of say "search predefined apertures for a match", then an indented block of pseudo code to describe the inner detail of "matching apertures".

> (newline removal... ) Would I have to include that in the pseudocode ?
No, that would be too detailed IMO.
You might mention it once as an additional comment the first time you used it, but that's about all.

> Would I have to include that in the pseudocode ?
One way to think about it would be that the pseudo code would become the block comments in the code. So it tells you a little bit more of "why" you're doing something rather than just merely restating "how" you're doing some things.

The idea being you could just paste your pseudo code into an empty source file, go through it putting /**/ comments around each line, then start filling in the details with actual code.

The for loop I would replace with a pseudo code line of say "search predefined apertures for a match", then an indented block of pseudo code to describe the inner detail of "matching apertures".

> (newline removal... ) Would I have to include that in the pseudocode ?
No, that would be too detailed IMO.
You might mention it once as an additional comment the first time you used it, but that's about all.

Interesting , thanks Salem . I agree wiith you , to me pseudocode should be like more descriptive comments , however it seems he wants us to use C style pseudocode , like what I did above. I have just sent him an email to clarify this . Do you know if the pseudocode needs to have comments ? It seems unnecessary , but our tutor mentioned that they are used ( he is a 2nd year student )