Forward declaring an enum in c++

Forward declaring an enum in c++

I'm trying to do something like the following: enum E; void Foo(E e); enum E{A, B, C}; which the compiler rejects. I've had a quick look on Google and the consensus seems to be "you can't do it",…


iphone - What does the term “opaque type” mean in the context of “CFBundleRef opaque type”?

Does someone have a good explanation of what an "opaque type" is? I saw that term in context of the CFBundleRef, where they were saying: "CFBundleRef opaque type". Is that a type that's readonly?…


Why can I assign structs but not compare them

Even though I am a long time C programmer, I only recently learned that one can directly assign structure variables to one another instead of using memcpy: struct MyStruct a,b;... a=b;/* implicit…


objective c - 100% opacity UILabel over a 50% opacity background(UIView?)

So right now I have a UIView with a UILabel in it. I want the background to have an opacity<1.0 and the label to have an opacity of 1.0. However since alphas propagate down the view hierarchy, the l…


Genericity vs type-safety? Using void* in C

Coming from OO(C#, Java, Scala) I value very highly the principles of both code reuse and type-safety. Type arguments in the above languages do the job and enable generic data structures which are bo…


pointer vs handles in C(are the terms used to convey separate things?)

Recently, I read a white paper by an individual who refers to a pointer to a struct as a handle. The author was clearly someone who had written C code on the windows platform previously. Googling in…


c++ - What is type safety and what are the “type safe” alternatives?

Possible Duplicates: What is Type-safe? What is type-safety? I was reading about c++ vectors and it was mentioned that memcpy and printf functions from C are not type safe. Article here: http://en.…


performance - How are 3D games so efficient?

There is something I have never understood. How can a great big PC game like GTA IV use 50% of my CPU and run at 60fps while a DX demo of a rotating Teapot @ 60fps uses a whopping 30% ?…


What defines an opaque type in C, and when are they necessary and/or useful?

I've seen the concept of 'opaque types' thrown around a bit but I really haven't found a succinct answer as to what defines an opaque type in C and more importantly what problems they allow us to sol…


iphone - UIView and subviews-opacity

Is it possible to make a UIView(and any other subviews within it) set to an opacity of say 0.5 or whatever? Not sure if this is even possible, but want to ask.…





typedef struct example pointer type java strong stack overflow handle