Home>
int len (double x []) {
int n = sizeof (x)/sizeof (x [0]);
return n;
}
int main (void) {
double x [] = {0,1,2,3,4};
int n = len (x []);
I want to create a function that returns the number of elements of an array outside the main function like, but even if I search for "how to pass a pointer" because my understanding is not enough No convincing answer was found.
I'm very happy if someone tells me.
-
Answer # 1
Related articles
- xcode - i want to create a function that returns an address by passing latitude and longitude as arguments!
- typescript - how to create a function that returns a return value (return value) of a specific type (function that determines ou
- javascript - i want to create a function that returns the execution result of connectionquery
- i don't know the function that rotates and returns the 8x8 dot character
- i want to create a function that gets the date and time and displays it
- i want to create a function that retrieves and displays multiple characters for date and time
- external function a function that returns the number of times it is called
- python 3x - i want to create a function that returns a list with the same name as the argument
- i want to create and utilize functions
- a function that returns a number from 1 to 52 in c++
- php - create a function that has a dummy argument of array $arr and passes an array array(1, 3, 5, 7,7, 9) containing numerical
- c - returns a string for the given number
- c language gpa calculation function
- java - i want to create a method that gets and returns the name corresponding to the number
- ruby - i don't know how to create a group function with rails and register a new participant there
- php - i want to create my own delete function with my own theme of wordpress
- i want to terminate the system started by the system function
- javascript - i want to use the value obtained by the function outside the function
- i want to create a search function with vuejs and laravel, but i do not know how to pass the search condition from vue to larave
- characters in the printf function are not output
Related questions
- i compared the same string with the strcmp function, but it was determined to be a different string
- how to add a string to one array without using strcat
- c - program that repeats 1000000 times and adds up all trials
- i want to clean up the output method for multiple arrays in c language
- [c language] editing distance;how to judge whether or not a memo is written
- creating a simple grade processing system in c language
- creation of a simple grade processing system using c language
- i want to make lowercase letters uppercase i want to reverse the order of letters
- i want to get the average of the numerical values under a specific condition
- numeric sort, half-width delimiter
Unfortunately, it isnotcreated as a function in C.
sizeof (x)
isbecause
. The pointerdoes not includeinformation about "size of the area you are pointing to".double x []
has the same meaning asdouble * x
>Pointer sizeA macro that expands a string on the spot is possible.