This question has already been answered:
There is a code:
void LongestWord(char* sen[]) { // Find & print longest word } int main(int argc, char* argv[]) { // Disable stdout buffering setvbuf(stdout, NULL, _IONBF, 0); // Keep this function call here LongestWord(gets(stdin)); return 0; } Task: How to calculate the number of sen[] elements in the LongestWord() function?
As far as I know, it is impossible to calculate through the pointer. Usually in such cases the size of the array is transferred along with the size_t type. This code is from coderbyte .
Maybe I'm not catching up with something?
gets()takes as an argument not the stream itself (this function is already nailed tostdin), but the output buffer, into which the contents of this stream are extracted to the nearest newline character. - ߊߚߤߘ