Reading a string with scanf

An array “decays” into a pointer to its first element, so scanf(“%s”, string) is equivalent to scanf(“%s”, &string[0]). On the other hand, scanf(“%s”, &string) passes a pointer-to-char[256], but it points to the same place. Then scanf, when processing the tail of its argument list, will try to pull out a char *. That’s the Right Thing when you’ve passed in string or &string[0], but when … Read more

Is XML a programming language?

A programming language? First, XML is a format to represent data. It has originally be designed for this data to be essentially text documents or messages, but nothing prevents you from representing any data you wish, including programs. There at least three big examples of programs expressed in XML that come to mind: XSLT is a Turing-complete language whose only standard format … Read more

Not equal to != and !== in PHP

== and != do not take into account the data type of the variables you compare. So these would all return true: === and !== do take into account the data type. That means comparing a string to a boolean will never be true because they’re of different types for example. These will all return false: You should compare data types for functions that … Read more

Is there ‘byte’ data type in C++?

No there is no byte data type in C++. However you could always include the bitset header from the standard library and create a typedef for byte: NB: Given that WinDef.h defines BYTE for windows code, you may want to use something other than BYTE if your intending to target Windows. Edit: In response to … Read more

Transparent background in JPEG image

You can’t make a JPEG image transparent. You should use a format that allows transparency, like GIF or PNG. Paint will open these files, but AFAIK it’ll erase transparency if you edit the file. Use some other application like Paint.NET (it’s free). Edit: since other people have mentioned it: you can convert JPEG images into PNG, in any editor that’s … Read more

Best Java obfuscator?

First, you really need to keep in mind that it’s never impossible to reverse-engineer something. Everything is hackable. A smart developer using a smart IDE can already get far enough. Well, you can find here a list. ProGuard is pretty good. I’ve used it myself, but only to “minify” Java code.