This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

array with names

hello to all of you,
is there a way to have a array and give each element of the array a special name?
An example:

float my_array[20];
.
.
for(i=0;i<20;i++)
send(my_array[i];
.
.
and each element of the array should have its special name like
1. actual_temperature
2. minimum_temperature
3. maximal_temperature
but the should share the same memory adress.

Sorry dont tell me Please read the manual, just give me a helpful hint.
Sincerly yours

Parents
  • is there a way to have a array and give each element of the array a special name?

    Yes, and no. Yes, it's possible, but the thing you have can't be called an "array", then. That's what C has structs for.

    but the should share the same memory adress.

    This completely fails to make sense. Array elements don't do that from the beginning.

    Sorry dont tell me Please read the manual, just give me a helpful hint.

    Now you're being arrogant, ridiculous, or both. How can you possibly know that Please read the manual isn't exactly the helpful hint you need?

    Actually, what you should read is not a manual. You're completely confused about basic aspects of programming in C. You should stop worrying about ARM, Keil and uVision, and go back to learning basic C skills. In that sense, you'll have to Please read the manual, but only later --- you desperately need to RTF textbook first.

Reply
  • is there a way to have a array and give each element of the array a special name?

    Yes, and no. Yes, it's possible, but the thing you have can't be called an "array", then. That's what C has structs for.

    but the should share the same memory adress.

    This completely fails to make sense. Array elements don't do that from the beginning.

    Sorry dont tell me Please read the manual, just give me a helpful hint.

    Now you're being arrogant, ridiculous, or both. How can you possibly know that Please read the manual isn't exactly the helpful hint you need?

    Actually, what you should read is not a manual. You're completely confused about basic aspects of programming in C. You should stop worrying about ARM, Keil and uVision, and go back to learning basic C skills. In that sense, you'll have to Please read the manual, but only later --- you desperately need to RTF textbook first.

Children
No data