char array
sokin
Posts: 32
in Propeller 1
Hello, I am new to doing this and am having some trouble. the directions I have are to use "char array" instead of "int array" to determine how many bytes each element has. I have tried changing int array to char array but get an error. Any suggestions on what I am doing wrong. Many thanks for the help.
#include "simpletools.h" // Include simpletools library
int array[5] = {11, 13, 17, 19, 23}; // array
int main() // Main function
{
print("array start address = %d \n\n", array); // Display array value
for(int i = 0; i < 5; i++)
{
print(" array[%d] = %d \n", i, array); // Display array value
print("&array[%d] = %d \n", i, &array); // Display array address
}
}
#include "simpletools.h" // Include simpletools library
int array[5] = {11, 13, 17, 19, 23}; // array
int main() // Main function
{
print("array start address = %d \n\n", array); // Display array value
for(int i = 0; i < 5; i++)
{
print(" array[%d] = %d \n", i, array); // Display array value
print("&array[%d] = %d \n", i, &array); // Display array address
}
}
Comments
However, your final print statements will only output the address of array, 8036 in my case. Adding the subscript i to array and &array yielded what you wanted per your comments.