Can someone quiz me?

I've been programming in C++ for a little over half a year now. I feel comfortable with many of the standard features of c++, but I decided I might as well as put myself at the mercy of the elite. Based on the amount of time I've been programming, what are some things you'd expect me to know? If I answer your question wrong, feel free to just give me a reference where I can learn the correct answer myself, I usually try to avoid that "give it to me now" mindset.

If I could get some help through this I'd be very grateful.
Last edited on
I don't think a quiz on random trivia is that useful for exercising/testing/demonstrating your ability.

The real test is:

- Can you write a program that does what you expect?
- Do you know how to read/understand/fix compiler errors?
- Can you find and fix runtime bugs when they come up?
- Is your code organized and easy for other people to understand?
-Depends on the difficulty, most of my projects yes however.
- Mostly, every once in a while I see something new.
-This can be a problem for me as I havent learned how to use a debugger yet
- I mostly keep it organized, but I have a bad habit of not always commenting clearly.

I was just hoping for questions such as

-When should you use a virtual deconstructor

My intentions for this were simply to determine my weak spots so I can work on them. Im not worried about demonstrating anything, but I'll respect your advice as you have a pretty good amount experience and rep in this community.
you can use GDB to debug when the run-time errors acur!
and if you want to actually find your bugs, i recommend to fix the wornings that the compiler give's
@Austin J


Well, can you say without using a compiler is the following code valid

1
2
3
4
5
6
struct A
{
   A( std::initializer_list<int> ) {}
};

A a {};
Last edited on
I suppose you mean do I know whether or not that will work without trying to compile it?

I believe that code goes into templates? I have seen that before, but not in that situation. std::initializer_list is for arrays of a datatype or object? I'm just going to honest I'm not able to make a good answer on that one. I'm going to guess yes, but...

The last part A a {}; is where you would actually initialize members of the list no? Wouldn't you have to do something on the lines of
A<int> = { /* stuff */ } ? I'm trying to remember, but it's been a while and it's not something I use as you can tell.
Last edited on
So as you see there are many things in the C++ that you should learn.:)
Last edited on
So as you see there are many things in the C++ that you should learn.:)


Oh yeah, wasn't questioning that part ;)
What are function objects (functors) good for?

What are, or are not, good uses of a singleton object? What are some problems that you need to watch out for when using a singleton object?

I you are building on a code base that does not use exceptions, should you use exceptions in your own code? If so, or not, how would you integrate the new code with the old code without the issue causing any extra problems?

Is there a problem with inheriting many protected variables? What does this indicate, and how might you mitigate the problem if there is one?

Why is it preferable to pass objects by const reference whenever possible rather than just by reference?

Shoud you always prefer to pass by reference? Is there any reason you might want to use a pointer instead?
Last edited on
Topic archived. No new replies allowed.