Timeline for appending string to char and vice versa
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 23, 2014 at 13:15 | comment | added | JRobert | I think it was I who started expressing array lengths as sums in an earlier thread w/ this OP. It isn't necessary to do but it documents why I made the array that long. The final sum is all the compiler cares about but '30+1' reminds me that I've allowed for the NUL terminator in my count. Likewise, '10 + 10 + 1' says I'm counting two strings and the terminator. It just serves to remind me how I arrived at the size. | |
Jun 22, 2014 at 22:28 | comment | added | Anonymous Penguin | @Peter Fixed that mistake.. | |
Jun 22, 2014 at 22:27 | history | edited | Anonymous Penguin | CC BY-SA 3.0 |
deleted 154 characters in body
|
Jun 22, 2014 at 21:57 | comment | added | Peter Bloomfield |
In C/C++, char clat[31] allocates 31 characters, not 32. The resulting elements are indexed 0 to 30 inclusive (i.e. there is no element 31).
|
|
Jun 22, 2014 at 21:19 | history | answered | Anonymous Penguin | CC BY-SA 3.0 |