1)Obtaining array dimension
For char arrays:
strlen() in <cstring>
char text[] = "Hello world.";
cout<<strlen(text);
For strings:
length() in <string>
string text;
cout<<text.length();
Other arrays:
sizeof(array_name)/sizeof(array_name[0])
2)What's the easiest way to obtain an array element from a user and placing it into memory?
Code:
double numbers[20];
for(int i=0; i<20; i++)
{
cout<<"Enter a floating point number:";
cin>>numbers[i];
}
3)As a result, I need to read double values and call an already written function to read these values.
some_function(numbers);