Square brackets and curly brackets in expressions?
#4
Not in QB64PE yet but:

square bracket had been used for fake array subscript into an allocated block defined by pointer, such as:

Code: (Select All)
int *pa, num;
pa = (int *)calloc(10, sizeof(int));
num = pa[0];  //first element
num = pa[9];  //last element

curly brace had been used in "initializer", ie. define the extent of an array or UDT and then put in the values for each element and/or field.

Even with those grouping characters besides parenthesis, we are still needing code editors highlighting which grouping character is paired with another one...
Reply


Messages In This Thread
RE: Square brackets and curly brackets in expressions? - by mnrvovrfc - 02-13-2023, 06:13 PM



Users browsing this thread: 4 Guest(s)