Quote:
Originally Posted by
lpaulgib
1. When I searched online for cstdlib, I got a list of functions and the explanation that it's for memory allocation and lists and sorts. Do I even need this in the program I'm using? The list of functions didn't show anything I use in that block of code.
The system() function is in there. system() is a function to be avoided, usually.
Quote:
2. cstdio looks like something for input/output, but online referencing says it's formatted IO functions. Can someone elaborate for an idiot? Once again... I don't see how I need it in this program.
cstdio is completely unnecessary for this program.
Quote:
3. ...int main(). I don't understand the (int nNumberofArgs, char* pszArgs[]) part. I searched the string on google, and got limited results. I was thinking maybe something to do with declaring an array or matrix with the [] brackets. Could someone explain this to me in a basic way. No need to go too deep. And once again..... Is this even necessary in this program?
No, it's not necessary in this program. And the reason your Google search didn't find anything is because those arguments are almost always called "argc" and "argv", not those silly names given here. Google "argc argv" and you'll get a ton of stuff.
Quote:
4. And finally.... I took out the books original content to include using namespace std. I read somewhere online that this is inefficient, and so instead I did the other method above in the code. Am I looking at this in the right way, or is there a potential problem with my styling of the code?
It isn't inefficient. It does have some very important ramifications whether you use a "using" declaration or specify namespaces explicitly. Until you know enough to understand those ramifications, I suggest doing it the way you're doing it now and stay away from "using" declarations.
Given just what you've posted here, that book looks like a piece of garbage. Unfortunately I don't know what books are good alternatives.
Good critical thinking. Impressed.