| | |
How can I write this coding?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2005
Posts: 6
Reputation:
Solved Threads: 0
There is a programming question. This is searching program. there is a string array. In this string array ther is a sentence. I get a word from the user . When the user's word is match with the sentence that is in the string , a message will appear ( found!!) and the number of count else (Not found!!).My coding:
main()
{
int count ;
char st1[80],st2[80];
char st[80]={ ncc education examination ncc ncc ncc education};
cout<< "Enter a word to be search";
cin>> st[];
int i=0;
{
while(st[i]!='/0')
{ st3[i]=st1[i];
st3++;
while((isspace(st[i])))
if( stcmp(st1,st3));
count++;
{cout<< "found";}
else {cout<<"Not fjound!!";}
}
st1[i]++;
}
}
Please test this program is wrong or true .If in this program have a little wrong please correct it
•
•
Join Date: Nov 2004
Posts: 108
Reputation:
Solved Threads: 3
1. Use complete sentences to describe what you are trying to accomplish so someone can understand what you are asking. So they do not have to lower themselves to a third grade level of reading to know what you are trying to ask.
2. Use code tags when posting code.
3. main returns an int it should be int main.
2. Use code tags when posting code.
3. main returns an int it should be int main.
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
![]() |
Similar Threads
- CODING QUESTION: What is the MOST importanting thing to do when...... (Computer Science)
- run time error '3290' for creating recordset (Visual Basic 4 / 5 / 6)
- problem in javascript coding in asp page (ASP)
- partial classes in 2005: neat but ? on event handlers (C#)
- Help with search coding (ASP)
- How can I write this program. (C++)
Other Threads in the C++ Forum
- Previous Thread: How can I write this program.
- Next Thread: total newb - "passing arg 2 of `strcpy' makes pointer from integer without a cast"
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






