| | |
please help to debug this
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 4
Reputation:
Solved Threads: 0
Please can anyone out there help me see the problem with this piece of code? I’ve tried running it on the visual studio compiler
But either get warnings or undesired output.
I supposed the code to be a little dictionary that compares
Inputs with some set of predefined ones and then output
It’s meaning if matches are found. Otherwise print NOT FOUND
And ask user to research.
Here’s the snippet:
here's the warning message from the compiler:
1>LINK : warning LNK4076: invalid incremental status file 'G:\arraysnd veators\Debug\arraysnd veators.ilk'; linking nonincrementally
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>LINK : warning LNK4076: invalid incremental status file 'G:\arraysnd veators\Debug\arraysnd veators.ilk'; linking nonincrementally
1>Build log was saved at "file://g:\arraysnd veators\arraysnd veators\Debug\BuildLog.htm"
1>arraysnd veators - 0 error(s), 2 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
But either get warnings or undesired output.
I supposed the code to be a little dictionary that compares
Inputs with some set of predefined ones and then output
It’s meaning if matches are found. Otherwise print NOT FOUND
And ask user to research.
Here’s the snippet:
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> #include <vector> using namespace std; int main() { bool chance = true; char *Dictionary[][2] ={ "God", "osalobua", "welcome", "obokhian", "jesus", "ijesu christy", "come", "lare", "friend", "ose", "school", "Esuku", "go", "kpa", "sun", "oven", "man", "okpia", "woman", "okhuo", "child", "omo", "baby", "omomo" }; while(chance) { int i; char word[20]; cout << "Enter a word and i'll tell\n" <<"you about it in edo language: "; cin >> word; for(i = 0; *Dictionary[i][0]; i++){ if(!strcmp(Dictionary[i][0], word)){ cout <<"\n"<<word <<" is translated" <<" as => " <<Dictionary[i][1] <<" \nin edo language "; break; } } if(!*Dictionary[i][0]){ cout <<"sorry! there's no matching word like"<<word; cout <<"will you like to search again?(y or n)"; string restart; cin>>restart; if(restart != "y") chance = false; } } return 0; }
here's the warning message from the compiler:
1>LINK : warning LNK4076: invalid incremental status file 'G:\arraysnd veators\Debug\arraysnd veators.ilk'; linking nonincrementally
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>LINK : warning LNK4076: invalid incremental status file 'G:\arraysnd veators\Debug\arraysnd veators.ilk'; linking nonincrementally
1>Build log was saved at "file://g:\arraysnd veators\arraysnd veators\Debug\BuildLog.htm"
1>arraysnd veators - 0 error(s), 2 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
•
•
Join Date: Jul 2005
Posts: 1,678
Reputation:
Solved Threads: 262
0
#2 30 Days Ago
You use the STL string class later in your program so why not use it here, too:
string Dictionary[12][2] ={ {"God", "osalobua"}, etc
and here:
string word;
Line 35 could then be:
for(i = 0; i < 12; ++i)
and Line 36 is simply
if(word == Dictionary[i][0])
with line 41 being :
if(i == 12)
You never use a vector, so why include the vector header?
string Dictionary[12][2] ={ {"God", "osalobua"}, etc
and here:
string word;
Line 35 could then be:
for(i = 0; i < 12; ++i)
and Line 36 is simply
if(word == Dictionary[i][0])
with line 41 being :
if(i == 12)
You never use a vector, so why include the vector header?
Klatu Barada Nikto
![]() |
Similar Threads
- Outlook giving a debug error (Windows Software)
- How do i debug this app? (Java)
- "Run time error, do you wish to debug?" (Web Browsers)
- cannot debug ASP (ASP)
- Need to debug (Web Browsers)
- Windows 2000 Debug file (Windows NT / 2000 / XP)
- Debug message (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: infinite while loop
- Next Thread: how to determine the size of the dynamic array
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






