Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Say what? Strange combobox behavior... Pin
Hamid_RT27-Jul-06 7:45
Hamid_RT27-Jul-06 7:45 
AnswerRe: Say what? Strange combobox behavior... Pin
lctrncs27-Jul-06 9:57
lctrncs27-Jul-06 9:57 
GeneralRe: Say what? Strange combobox behavior... Pin
lctrncs27-Jul-06 12:50
lctrncs27-Jul-06 12:50 
QuestionCommon Dialog Box'es Pin
G_S26-Jul-06 9:04
G_S26-Jul-06 9:04 
AnswerRe: Common Dialog Box'es Pin
Zac Howland26-Jul-06 9:17
Zac Howland26-Jul-06 9:17 
AnswerRe: Common Dialog Box'es Pin
PJ Arends26-Jul-06 9:18
professionalPJ Arends26-Jul-06 9:18 
AnswerRe: Common Dialog Box'es Pin
Hamid_RT26-Jul-06 19:32
Hamid_RT26-Jul-06 19:32 
Questionsearching within strings Pin
jon-8026-Jul-06 8:18
professionaljon-8026-Jul-06 8:18 
I'm trying to code a function which returns the number of words in an array, strSentence[100, 1000].

Algorithm:
1. return the first occurrence of strWord.
2. Remove strWord from strSentence.
3. Repeat the above steps until (1) returns no value.

I am using strstr to return the first occurrence of strWord within strSentence. However, the following error is being displayed:
SentenceAr.cpp(94): error C2664: 'strstr' : cannot convert parameter 1 from 'char [100][1000]' to 'const char *'

Code:

int CSentenceAr::HowManyWords(const char strWord[MAX_WORD_LENGTH])
{ char *strCurrentSentence;
ZeroMemory(strCurrentSentence,sizeof(strCurrentSentence));
char *ptrPosition;

for (int iCurrent = 1; iCurrent <= iNumberOfLines; iNumberOfLines++)
{ strcpy(strCurrentSentence, strSentence[iCurrent]);
ptrPosition = strstr(strSentence, strWord);

}

Any work around for this, please?

Jon
AnswerRe: searching within strings Pin
Chris Losinger26-Jul-06 8:19
professionalChris Losinger26-Jul-06 8:19 
AnswerRe: searching within strings Pin
David Crow26-Jul-06 8:22
David Crow26-Jul-06 8:22 
GeneralRe: searching within strings Pin
jon-8026-Jul-06 9:12
professionaljon-8026-Jul-06 9:12 
GeneralRe: searching within strings Pin
David Crow26-Jul-06 9:18
David Crow26-Jul-06 9:18 
QuestionRe: searching within strings Pin
jon-8026-Jul-06 10:05
professionaljon-8026-Jul-06 10:05 
AnswerRe: searching within strings Pin
David Crow26-Jul-06 10:12
David Crow26-Jul-06 10:12 
AnswerRe: searching within strings [modified] Pin
Zac Howland26-Jul-06 10:17
Zac Howland26-Jul-06 10:17 
GeneralRe: searching within strings Pin
jon-8027-Jul-06 7:46
professionaljon-8027-Jul-06 7:46 
GeneralRe: searching within strings Pin
Zac Howland28-Jul-06 3:38
Zac Howland28-Jul-06 3:38 
GeneralRe: searching within strings Pin
jon-8028-Jul-06 8:08
professionaljon-8028-Jul-06 8:08 
GeneralRe: searching within strings Pin
Zac Howland28-Jul-06 9:05
Zac Howland28-Jul-06 9:05 
GeneralRe: searching within strings Pin
jon-8028-Jul-06 22:18
professionaljon-8028-Jul-06 22:18 
AnswerRe: searching within strings Pin
jon-8028-Jul-06 22:53
professionaljon-8028-Jul-06 22:53 
GeneralRe: searching within strings Pin
jon-802-Aug-06 10:07
professionaljon-802-Aug-06 10:07 
AnswerRe: searching within strings Pin
Zac Howland26-Jul-06 9:13
Zac Howland26-Jul-06 9:13 
QuestionHow to write to DataBase MS Access Pin
nahitan26-Jul-06 7:28
nahitan26-Jul-06 7:28 
AnswerRe: How to write to DataBase MS Access Pin
Hamid_RT26-Jul-06 7:36
Hamid_RT26-Jul-06 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.