# Thread: Need study help : /

1. thnx man, i am really going to enjoy the system dependant answer, seriously i cant wait till she marks it wrong.

2. >>Explain the empty for loop

The counter is declared and initialized outside of the loop condition but referenced in conditional statements within the loop.
Wrong!!
"Empty" refers to the loop body. It just means that all the "action" is inside the parentheses. An example is:
Code:
`for( d=2; d < n && n / d != 0; d++ ) ;  // exits loop when d is a divisor of n (or d==n)`
Some people prefer this style:
Code:
```for( d=2; d < n && n / d != 0; d++ )
;```
or this:
Code:
```for( d=2; d < n && n / d != 0; d++ )
{};```
to make it clear that it's not just a mistake.

Another name for this is a Null Statement.

3. are you sure she's not looking for a relativity answer? as in:

unsigned<float<double

4. golfinguy4:

Are you sure? I've only seen for(;;); referred to as an infinite loop, same as while(1);

RoD:
Your post wasn't clear. Did teacher give for(;;) as an example?

5. well i asked bout it today and i posted what she said she wanted.

Code:
```int i = 0;

for (; i < 5; i++)
{
cout << "Runs 5 times!" << endl;
}```

6. that just means the LCV is initialized outside the loop...

7. 98) List the data types and number of bytes each:

I have NO idea what the bytes are, but i listed char, int, double, float, bool, and string cuz we did those.
Missed a couple there... Off the top of my head,

char, int, short, long (each of which comes in signed and unsigned flavors)
bool, float, double, long double

8. ya i only listed the ones she actually went over, cs2 sux for us

9. Well, I don't see how she can call that an empty anything. It's not empty. I see examples like the one I posted and examples like the one golfinguy posted both being called empty loops. They both make sense. I don't see any that look like your teacher's.

But she's marking the test. Too bad. Maybe you can ask her again, & show her our examples, before the test.

Good luck.

10. Yeah, I'd say Stiltskin's is probably the most correct definition of empty loop... golfinguy's is probably technically an infinite loop, and not empty.

Also, on the structure of a program, I'd put something like this (in no particular order):

Pre-processor
Global-Scope/Namespace-Scope Constants (If your teacher is really picky, I suppose typedefs would go here too)
Function Prototypes
Class Declarations
Class Definitions
Driver (i.e. main)

11. Yeah, my empty loop was wrong. I misread what he wanted.

12. well the test is in a few hours, and thnx to you guys im sure i'll pass it, thank ya.

13. good luck ;-)

14. 110 question study guide, TWO questions on the actual test. god i really hate that \$\$\$\$\$

15. And the real test was to see if you could keep your sanity after all that.