Short questions...

This is a discussion on Short questions... within the C++ Programming forums, part of the General Programming Boards category; I'm porting from C to C++ (finally ) and I have a few questions that I was unable to find ...

An inline function needs to be visible to every translation unit using it. In short, this means you have to define an inline function in your .hpp file (you are using .hpp and not .h, RIGHT?). A defintion is the one with { and }. Consequently, this means you can just define the function with the class itself since class defintions need to be visible to every translation unit too. Finally, any function defined inside the class definition is implicitly inlined. Which means you don't need the inline keyword. Also, inline is *merely* a compiler suggestion. Your compiler is free to completly disregard it. So in otherwords, don't expect much from 'inline'. In general I'd suggest avoiding explicitly inling things since your compiler will probably inline anything that should be regardless. Not to mention optimization shouldn't be your concern at this stage.

Yes, you do need using namespace std;. If your textbook does not use it then it is not a C++ textbook and you should burn it.

Get Thinking in C++ if you are cheap and don't want to buy a real book (it is free and online). Otherwise I'd suggest buying Accelerated C++.
FYI, this board keeps on demanding i use code tags, but since I don't have any code I don't see what it wants me to put in the tags. Perhaps someone should look into that.

It probably has something to do with you using curly brackets in your explanation. Of course, a way around this would be to use the phrase 'curly brackets' instead of actually using the character.

Alternatively, the webmaster could refine the string parsing algo which they obviously use before each thread can be submitted?

Although you have to appreciate, many bugs exist, be it due to the fact ppl using different browsers or deficiencies in the web source code. I believe there is a sticky about reported bugs in one of the forums?

Inlining a function will save that great big overhead time it takes to call a function (push return onto stack, change EIP, execute, pop ret back into EIP and continue). Of course this really isn't much at all, but in a critical section of your code, the inline could potentially save a bit of time. Anyways, the C++ FAQ-Lite has a little bit of info on defining inline functions

Inlining a function will save that great big overhead time it takes to call a function (push return onto stack, change EIP, execute, pop ret back into EIP and continue). Of course this really isn't much at all, but in a critical section of your code, the inline could potentially save a bit of time. Anyways, the C++ FAQ-Lite has a little bit of info on defining inline functions

So basically inline functions are that of not processing it THEN computing it, it just reads it and computes it on the fly? Am I wrong?

From a practical standpoint, this separation makes life easier and safer for your users. Say Chuck wants to simply "use" your class. Because you read this FAQ and used the above separation, Chuck can read your class's public: part and see everything he needs to see and nothing he doesn't need to see. His life is easier because he needs to look in only one spot, and his life is safer because his pure mind isn't polluted by implementation minutiae.

Back to inline-ness: the decision of whether a function is or is not inline is an implementation detail that does not change the observable semantics (the "meaning") of a call. Therefore the inline keyword should go next to the function's definition, not within the class's public: part.

NOTE: most people use the terms "declaration" and "definition" to differentiate the above two places. For example, they might say, "Should I put the inline keyword next to the declaration or the definition?" Unfortunately that usage is sloppy and somebody out there will eventually gig you for it. The people who gig you are probably insecure, pathetic wannabes who know they're not good enough to actually acomplish something with their lives, nonetheless you might as well learn the correct terminology to avoid getting gigged. Here it is: every definition is also a declaration. This means using the two as if they are mutually exclusive would be like asking which is heavier, steel or metal? Almost everybody will know what you mean if you use "definition" as if it is the opposite of "declaration," and only the worst of the techie weenies will gig you for it, but at least you now know how to use the terms correctly.

They grand FAQ wouldn't just leave you with a "because it is", they explain it too

@blank-stare: inline functions are expanded (all the code is placed into the calling function) at compile time, saving to function call. This is somewhat analogous to a #define like function, however, there are differences. I suggest reading the linked C++ FAQ-Lite entries for these.