Hopefully he will be back and has tried more :)
Printable View
Hopefully he will be back and has tried more :)
Paul McKenzie,
Please do not respond to any more of my posts including this one. I am really not needing to hear your comments anymore. I tried the code but I keep getting the same issue with the same errors...
'Palindrome.exe': Loaded 'C:\Users\Bryan\Documents\CSI 345\Palindrome\Debug\Palindrome.exe', Symbols loaded.
'Palindrome.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Palindrome.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Palindrome.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Palindrome.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'Palindrome.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[1240] Palindrome.exe: Native' has exited with code 0 (0x0).
These errors keep going to the same place which is if (argc>1) and my newest try which is at if (argc ==3) I also went to goggle to make sure generate debug info is saved to yes and it was
And I did not mean that post as negative to anyone else but Ill never use C++ again and just trying to get through this last program before thursday which is my last deaddline
How are you executing the program from the command prompt ? If
you are using argc==3 , you need to execute with something like:
Palindrome.exe input_file_name output_file_name
As I mentioned in my first post, why are you using argc and argv ?
Why not just hardwite the names of the files ?
Try my code and report the error any error. Also read about microsoft visual studio and setting up command arguments http://stackoverflow.com/questions/2...-visual-studio
or do what Philip suggest since it is easier to start with.
Theses errors are of no concern to your problemQuote:
Originally Posted by jimJohnson123
It is just because you think you are "not needing to hear your comments anymore". It is verz bad but for you only! :thumbd:
I would suggest you to use neither any type of programming nor any work concerning logic and mathematics. :cool:
Sorry, CodeGuru doesn't work like that.
If you answered the questions I asked you, maybe you would solved the problem you're having. The questions I asked you are relevant to this entire discussion. You have an issue, and the issue is that you did not understand why an "else" block was executed, and I explained it to you very clearly. The reason why was that a variable, namely argc, was set to a number. Then I politely asked you where argc gets its value, but you couldn't answer.
The only conclusion that anyone can make from this is that you don't know what you've programmed, and you're relying on basically copying what Joeman and others are giving you and hoping it works.
Regards,
Paul McKenzie
Programming just isn't made for everyone, yet everyone who takes up programming thinks they can tackle the work.
When it comes to logical thinking and thinking in discrete steps to reach a final goal, some persons have brains that are just not wired for this type of thinking, regardless of how smart they are in other fields.
Regards,
Paul McKenzie
the reason i use argc and argv is because it is required
And in my programs I write, I'm also required to use argc and argv in many cases. The difference is that I know what they are used for, and I'm asking if you know what they are used for.
The entire reason for this thread from the start is that you didn't understand what these values are or what their purpose is. The value of argc was causing that message to be printed out, and that again is because the if() statement that you wrote says to print that message if argc <= 1.
I didn't write that if() statement, you wrote it, so it's expected and assumed that you are able to understand what you had written.
Regards,
Paul McKenzie
What if I changed them to like...
int main(int argc[], char *argv[]){
HANDLE readFile, writeFile;
HANDLE readFileMap, writeFileMap;
PVOID pvreadFile, pvwriteFile;
DWORD readFileSize;
string word = "";
list<string> words;
//VERIFYING ARGUMENTS
if(argc[3]>1)
You shouldn't be coding blindly and hoping something that works. The main() function has the following signature:
You cannot change this -- if you did, the code will not compile.Code:int main(int argc, char *argv[])
// or
int main()
The first parameter is not an array of int, it must be a single int. But I'll ask again, what does argc mean in that parameter list? What is its purpose? Say if argc == 2, what does the "2" mean?
This should be stated clearly in the C++ book that you're using as to the purpose of these two parameters, argc and argv, to the main() function.
Regards,
Paul McKenzie