How to split a string literal across multiple lines in C / Objective-C?

I have a pretty long sqlite query: const char *sql_query = “SELECT statuses.word_id FROM lang1_words, statuses WHERE statuses.word_id = lang1_words.word_id ORDER BY lang1_words.word ASC”; How can I break it in a number of lines to make it easier to read? If I do the following: const char *sql_query = “SELECT word_id FROM table1, table2 WHERE … Read more

Insert text with single quotes in PostgreSQL

I have a table test(id,name). I need to insert values like: user’s log, ‘my user’, customer’s. insert into test values (1,’user’s log’); insert into test values (2,”my users”); insert into test values (3,’customer’s’); I am getting an error if I run any of the above statements. If there is any method to do this correctly … Read more

Difference between string object and string literal

When you use a string literal the string can be interned, but when you use new String(“…”) you get a new string object. In this example both string literals refer the same object: String a = “abc”; String b = “abc”; System.out.println(a == b); // true Here, 2 different objects are created and they have different references: String … Read more