• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C++ Help

Tarrant64

Diamond Member
I've got this take home quiz and I don't quite understand whether this would be anytime, or never:

When is it permissible to declare pointer variables within a structure (struct data type)?

- anytime, linked-lists use pointers (settled on this after talking to friend)
-only when all data elements are of type char
- never
- only when the struct data variables are declared locally

Can someone help me out?
 
Professors sometimes come up with the stupidest questions, don't they? Does he (or she) mean permissible syntactically? Then your answer is correct. More likely he (or she) means "permissible according to my personal system design principles," in which case, you'd know better than I.
 
Process of elimination rejects the other 3 options w/ respect to your bolded question
 
I would say what you marked, or never. But it really depends on what the professor has said in class (Like Mark said, whatever dumb standard they have concocted)

Ultimately, any of those answers could be correct depending on what he/she said in class. But it is certainly a bad/poorly worded question.
 
I was thinking D, only because I never user pointers in my remotely declared structure type variables.
 
Originally posted by: degibson
Its B.

I have no problem using integer pointers or void pointers

The way B is worded is that only char can be pointers.
That is great with strings, but not so when using other data types.

 
Originally posted by: degibson
Its B.

Oops. I thought the posts above me had firmly convinced you that the entire question was bogus. I added this because I wanted to stir the mud -- nothing more. Correct answer is A of course.
 
Back
Top