C++ equivalent of java’s instanceof

Try using: This requires your compiler to have rtti support enabled. EDIT: I’ve had some good comments on this answer! Every time you need to use a dynamic_cast (or instanceof) you’d better ask yourself whether it’s a necessary thing. It’s generally a sign of poor design. Typical workarounds is putting the special behaviour for the … Read more

A field initializer cannot reference the nonstatic field, method, or property

This line: You cannot use an instance variable to initialize another instance variable. Why? Because the compiler can rearrange these – there is no guarantee that reminder will be initialized before defaultReminder, so the above line might throw a NullReferenceException. Instead, just use: Alternatively, set up the value in the constructor: There are more details about this compiler error on MSDN – Compiler Error … Read more

Categories c# Tags

SDK Location not found in android studio

A quick note about this if trying to run a Facebook sample and this error pops up, make sure you select the build.gradle file in the root of Facebook sdk, for all the samples when ‘opening an existing project’. I got this error when I tried to open the gradle for just the Scrumptious sample … Read more

td widths, not working?

It should be: or Note that if your cell contains some content that doesn’t fit into the 200px (like somelongwordwithoutanyspaces), the cell will stretch nevertheless, unless your CSS contains table-layout: fixed for the table. EDIT As kristina childs noted on her answer, you should avoid both the width attribute and using inline CSS (with the … Read more