Thank you.
So then why when I do this it wont change the value of str?
string str = "103";
cout << "result: " << str[0] - '0' << "\n\n";
cout << "result: " << str[1] -...
Type: Posts; User: Ducky
Thank you.
So then why when I do this it wont change the value of str?
string str = "103";
cout << "result: " << str[0] - '0' << "\n\n";
cout << "result: " << str[1] -...
I found this code on the internet and I don't understand whats the point of this line : (str[i] - '0')
I know its not working without it but whats the point of subtracting 0 of something?
...
No, not sub-process, just opens a file simply.
But you gave me an idea, maybe if I open it up from a thread I could check for the thread if its still running.
I want my program to detect when a file is closed in order to encrypt it again.
Is there a better way to do this than checking periodically the process list if the program opened the file is still...
Yes, that's a simpler solution than mine.
With only the modulus operator you replaced half of my code :)
Thank you Salem.
Ah, of course, thanks!
No, Names[1] will access the second letter in each name, returns:
a
i
o
I didnt express myself clear enough, I meant second element of the list.
I would like to access "Dick".
I guess we...
Hello
Can you access only a specific element in a for each loop?
For example how would I print only the second element in the Names array?
#include <windows.h>
#include <array>
#include...
No, finally its not permutation what I was looking for.
This is permutation:
abc
acb
bac
bca
cab
cba
Thank you, yes, its permutation what I was looking for, with permutation it is much simple.
I managed to do it with for loop after all.
#include <windows.h>
#include <iostream>
using...
Hello and Happy New Year,
I would like to loop through a list of names infinitely like this:
Harry
Dick
Tom
===
Dick
Tom
Hello
Im trying to debug WM_KEYDOWN messages in Visual Studio 2022 in order to see why I dont get Ctrl-A message in the second edit box but I dont see any message in the debug output window.
Im...
My vector is used as an unsigned char array, I guess I could assign a string object to an unsigned char array too.
Thank you laserlight.
I have a char vector with text in it.
I'd like to split it into strings at every new line.
Is it better to assign the vector to a string first or is there a function that can do this with the...
Thank you, that was it.
I am trying to use a C++ string as the key for xoring another string.
The program crashes with (0xC0000005) Access violation.
Though it works if the key is declared as char key[260].
#include...
I read it on MSDN that it should be sent through WM_NOTIFY.
And that the iSubItem number has to be put in a NMLISTVIEW structure.
But where do I put the NMLISTVIEW structure to tell it to which...
Thats true, I didnt think about this.
Just added the include files you suggested. But it compiles without them also and I get the good result 1.
Anyway I realized that numbers cannot be compared as strings because they will be...
Thank you Jim,
Now, I get 1 too on strcmp(). I dont understand why I got 0 before.
Hi, I need to compare two numbers.
If the numbers are not made out of the same number of digits strcmp() will return 0 meaning that they are equal.
strncmp() will return the correct answer 1,...
The program is working fine, it's just that the resource file will be a 16-bit program once it's created.
I prefer CodeBlocks as editor for just a simple test program.
I created a project in...
No, no, I was just putting it simple. Of course after rc.exe I compiled it with command: cl.exe program.cpp resource.res, and it compiled successfully.
I compiled calc.exe 32-bit with with the resource compiler rc.exe in command line, on Windows 10 with VS 2017.
When I try to execute it, after loading the resource and writing it to a file, I get...
Thank you Sir, clear explanation, helped a lot!