Click here to Skip to main content
15,909,898 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Most head-slapping feature in a language Pin
Christian Graus17-Apr-19 12:37
protectorChristian Graus17-Apr-19 12:37 
GeneralRe: Most head-slapping feature in a language Pin
Super Lloyd17-Apr-19 13:18
Super Lloyd17-Apr-19 13:18 
GeneralRe: Most head-slapping feature in a language Pin
Christian Graus17-Apr-19 15:30
protectorChristian Graus17-Apr-19 15:30 
GeneralRe: Most head-slapping feature in a language Pin
#realJSOP18-Apr-19 1:39
professional#realJSOP18-Apr-19 1:39 
GeneralRe: Most head-slapping feature in a language Pin
Peter_in_278017-Apr-19 12:42
professionalPeter_in_278017-Apr-19 12:42 
GeneralRe: Most head-slapping feature in a language Pin
Super Lloyd17-Apr-19 13:19
Super Lloyd17-Apr-19 13:19 
GeneralRe: Most head-slapping feature in a language Pin
Alister Morton18-Apr-19 5:50
Alister Morton18-Apr-19 5:50 
GeneralRe: Most head-slapping feature in a language Pin
englebart18-Apr-19 7:02
professionalenglebart18-Apr-19 7:02 
I had never thought about pointer arithmetic being commutative before... seems consistent at least.

int index = 1;
char *address = "String";

index[address] is the same as *(index + address)

address[index] is the same as *(address + index)
  • implicitly includes the size of the base data type. (char)
If this was attempted with variables instead of constants, you might end up with memory protection issues. Most OSes would not want you to start a loop by loading memory address 1 into a register.
They would let you load the memory address of "String"
GeneralRe: Most head-slapping feature in a language Pin
Christian Graus17-Apr-19 15:40
protectorChristian Graus17-Apr-19 15:40 
GeneralRe: Most head-slapping feature in a language Pin
Gary Wheeler20-Apr-19 3:07
Gary Wheeler20-Apr-19 3:07 
GeneralRe: Most head-slapping feature in a language Pin
Sander Rossel17-Apr-19 20:36
professionalSander Rossel17-Apr-19 20:36 
GeneralRe: Most head-slapping feature in a language Pin
Davyd McColl17-Apr-19 21:14
Davyd McColl17-Apr-19 21:14 
GeneralRe: Most head-slapping feature in a language Pin
CodeWraith17-Apr-19 23:22
CodeWraith17-Apr-19 23:22 
GeneralRe: Most head-slapping feature in a language Pin
Simon_Whale17-Apr-19 23:26
Simon_Whale17-Apr-19 23:26 
GeneralRe: Most head-slapping feature in a language Pin
markchagers17-Apr-19 23:30
markchagers17-Apr-19 23:30 
GeneralRe: Most head-slapping feature in a language Pin
Chris Maunder18-Apr-19 3:25
cofounderChris Maunder18-Apr-19 3:25 
GeneralRe: Most head-slapping feature in a language Pin
MikeTheFid18-Apr-19 5:43
MikeTheFid18-Apr-19 5:43 
GeneralRe: Most head-slapping feature in a language Pin
kalberts18-Apr-19 1:22
kalberts18-Apr-19 1:22 
GeneralRe: Most head-slapping feature in a language Pin
Asday18-Apr-19 1:56
Asday18-Apr-19 1:56 
GeneralRe: Most head-slapping feature in a language Pin
Kirk 1038982118-Apr-19 2:36
Kirk 1038982118-Apr-19 2:36 
GeneralRe: Most head-slapping feature in a language Pin
jfren48418-Apr-19 3:00
jfren48418-Apr-19 3:00 
GeneralRe: Most head-slapping feature in a language Pin
Timothy Purdy18-Apr-19 5:13
Timothy Purdy18-Apr-19 5:13 
GeneralRe: Most head-slapping feature in a language Pin
Dan Neely19-Apr-19 3:23
Dan Neely19-Apr-19 3:23 
GeneralThought of the Day Pin
OriginalGriff17-Apr-19 4:44
mveOriginalGriff17-Apr-19 4:44 
GeneralRe: Thought of the Day Pin
CodeWraith17-Apr-19 4:51
CodeWraith17-Apr-19 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.