Discussion Overview
The discussion revolves around searching for a substring within a string in the C programming language and counting the number of occurrences of that substring. It includes technical explanations and clarifications regarding the appropriate functions to use.
Discussion Character
- Technical explanation, Conceptual clarification
Main Points Raised
- One participant asks how to search for a substring within another string and count its occurrences, expressing uncertainty about the counting aspect.
- Another participant suggests using the function 'substr' to find the first instance of a substring and recommends calling it repeatedly to count occurrences.
- A different participant corrects the previous suggestion, indicating that 'strstr' is the appropriate function in C for this purpose, not 'substr'.
- Another participant acknowledges the mix-up and clarifies that while 'string.find' and 'string.substr' are used in C++, 'strstr' is the correct function in C.
Areas of Agreement / Disagreement
There is no consensus on the initial suggestion to use 'substr', as it is corrected by other participants who emphasize the use of 'strstr' in C. The discussion reflects differing views on the appropriate functions to use for substring searching.
Contextual Notes
The discussion does not resolve the specifics of implementing the counting mechanism or the handling of edge cases in substring searching.