Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20748

BASCOM-AVR : Questions regardling Structures, overlays and arrays : REPLY

$
0
0
1. Bascom knows basically only one-dimensional arrays. More dimensions have to be set up and handled by user code. The only two-dimensional built-in array I know, would be an array of strings. There the index is the first dimension, while the addressed string itself is the second dimension. But one needs to use then string functions, while one wants to work maybe with a byte array. The terminator byte is also a waste then and I feel it too complicated. Before using such workarounds, I'd have already written code, to handle these multiple dimensions and project it onto one large byte array. 2. An overlay uses the same memory space of one variable, by laying over another variable on it. That's where the name comes from. The overlaying variable can be of a different type than the overlaid one. The shown sample makes little sense, while it can be done. However, I miss the meaning of overlaying a single string with length of 5 chars (included terminator) onto a word array of 20 words. Overlay does not create a structure, nor can it be repeated by any parameters. 3. No.

Viewing all articles
Browse latest Browse all 20748

Latest Images

Trending Articles



Latest Images