Click here to Skip to main content
15,301,553 members

Comments by merano99 (Top 128 by date)

merano99 5 days ago View
5, The real way to do this.
merano99 8-May-22 16:30pm View
The code snippet is .Net/CLI. Is help needed based on this, or should C++ be used?
A more detailed description of the desired functionality is probably required.
From the existing text I would assume that several form pages should be programmed, each with a forward and back button. For example, MFC AppWizard would generate something like this if you select property sheet with wizard mode.
merano99 7-May-22 20:24pm View
Since the solution works, you get my 5, but I would prefer a pure C++ solution.
merano99 24-Apr-22 6:53am View
Code is incomplete. Missing struct student and substruct mark.
merano99 22-Apr-22 15:03pm View
Show us your source code and ask specific questions about it. There will be no solution service here.
Note on the solution here: The numbers should only be output, storing all numbers in an array does not seem to be required.
merano99 22-Apr-22 12:53pm View
In this particular case, it's an easy task. Almost no feature of C++ is used. What the many C++ includes are there for is not clear. There was someone at work who didn't exactly know what he was doing.
merano99 22-Apr-22 12:48pm View
I am of course aware of this fact. However, a solution can also be used for learning. Anyone who tries to get along with copy & paste is neither willing to learn anything nor has they understood anything.
A turnkey solution that can be handed over directly without any personal contribution would really not make sense here. I agree.
merano99 21-Apr-22 18:48pm View
To be able to output m_name with cout, m_name.c_str() might be necessary.
merano99 21-Apr-22 18:38pm View
Almost fine, but would have a two comments:

1. The compiler complains about the const declaration: this pointer cannot be converted from "const person" to "person &".

2. Missing <string> include and code should use std::string.
merano99 16-Apr-22 4:07am View
Remove your code here and improve your question above with it. Please use C code tags.
merano99 16-Apr-22 4:05am View
Remove your code here and improve your question above with it. Please use C code tags.
merano99 15-Apr-22 13:27pm View
I would also accept your assumption that a copy'n'paste job went very wrong here. Someone who doesn't see this at first glance probably doesn't know exactly what he's actually doing. Apparently some lines of code have been duplicated and copied into each other. Nobody can read it like that. I removed the obvious duplicates and made small changes. The code looks like a typical Arduino program. Apparently other important information is missing as well.
Since we don't know exactly what the problem is, we can't go any further here without the author writing where exactly the problem is. After the rearrangement, the program can now be compiled without any problems...
merano99 15-Apr-22 6:10am View
The author seems to be very unclear here: The task was actually "You are given a 3x3 matrix", but it was
declared differently here. How the syntax of C works is also extremely unclear. Under such conditions it's
going to be a challenge. Nothing is said about the mathematical background.
merano99 15-Apr-22 3:54am View
Thanks! Allocate the memory is simple: *nbuf = (char*)malloc(length + 1);
merano99 14-Apr-22 21:17pm View
The GetComputerNameExA() function works fine in a DLL. Provided that the text fits in the buffer and the terminating 0 is present. The Function strlen can kill your program at this point. I would suggest only write: buffer[length] = 0;
merano99 13-Apr-22 11:16am View
Its your Code, so its up to you to learn that this does not what you want.
case1:cout<<"balance is"<
merano99 10-Apr-22 5:33am View
+5, see comment in my solution
merano99 7-Apr-22 20:06pm View
You mean VMR, right?
merano99 3-Apr-22 19:57pm View
How the value 10 is calculated in the example is unclear. How exactly is the example calculated?
merano99 25-Mar-22 22:36pm View
kbhit (conio.h) it is not only available at Borland.
merano99 15-Mar-22 17:38pm View
very nice solution. (my 5)
To calculate a tip with range i would suggest
int GenTip()
std::random_device rd; // define random device
std::mt19937 gen(rd()); // seed the generator
std::uniform_int_distribution<> distr(0, 10); // define the range
return distr(gen); // generate number

Note: the solution functionally covers the task well, but the reference to the circular linked list doesn't seem to be fulfilled?
"(i)Code the above scheme in C++, insert 0 when initializing circular linked list."
On the other hand, a circularly linked list would hardly be sortable.
It is unclear what the task giver was thinking.

You accept negative tips?
merano99 8-Mar-22 18:29pm View
Richard had expressed the assumption that you are opening a modal dialog that cannot easily be minimized.
But we don't know what the dialog is used for, why it needs to be minimized and ultimately whether it should be a dialog at all. One might also ask why a modal dialog is used and not a non-modal one, or the other way around, why would you want to minimize it. There are many possibilities to change something here and the statement that it is not possible is not true with some certainty.
merano99 28-Feb-22 18:11pm View
OK. Didn't think the solution was that simple. I wrote this as a solution. I would be happy if the solution is accepted.
merano99 25-Feb-22 18:18pm View
Did you try SetBkMode(hdc,TRANSPARENT); ?
merano99 24-Feb-22 18:33pm View
If a Python solution is desired, why is the question also marked as C++?
Completely different solutions could possibly be considered here.
merano99 7-Feb-22 17:13pm View
Only a few letters wrong, see my solution:-)
merano99 6-Feb-22 18:43pm View
You tagged the Question with many Tags: C++, C#, QT
The techniques are not compatible and, moreover, one could propose a solution with Win32 or MFC or .NET for C++ alone. It is best to show the existing code and only use tags for techniques that should also be used.
There is not enough information to be able to help here.
merano99 1-Feb-22 18:41pm View
But that would be part of the task anyway: "Has appropriate getters and setters"
merano99 25-Jan-22 14:59pm View
What does the compiler say?
Everything is required except for the one line with PrepareFaceBank(std::string Path). The prototype should actually be somewhere. However, it is not in the linked document.
In addition, you should write a function yourself that frees up the memory. For testing, it should run like this.
merano99 25-Jan-22 10:37am View
I've just adjusted my suggestion a bit so that it compiles without errors.
merano99 25-Jan-22 9:06am View
See my solution for a wrapper that wraps the C++ data for delivery via a C DLL. Someone in the .NET forum probably knows how to unpack it in C#.
merano99 22-Jan-22 19:51pm View
What is your Question?
The task would be to read the text row by row, since the row number should be output.
merano99 12-Jan-22 16:59pm View
When the Program crashes bevor the loop the static array
struct star s[201][201];
and other local stuff is possibly to much for your Stack.
merano99 8-Jan-22 19:50pm View
I suggest providing the option of specifying the number of rooms in the constructor.
Floor::Floor(int nrooms=0): available_rooms(nrooms){ }
merano99 3-Jan-22 16:25pm View
"I tried to solve this code ..."
Please show the code so we can talk about it. Without an approach, you usually can't go any further here.
merano99 2-Jan-22 20:02pm View
In atlstr.h you will find:

Line 1296 - typedef CAtlString CString;

so why not use CString?
merano99 2-Jan-22 19:54pm View
MFC and ATL are both included in the free Visual-Studio Community Edition.
I can't say whether the atlstr.h could be used with a compiler other than Visual-Studio. You will surely be able to look at the headers.
(By the way: Fortunately, the times of the cropped express versions are over.)
merano99 28-Dec-21 20:22pm View
To save and load a string, I would use a string instead of
char value[value_size+1];
You would then no longer have to worry about the length.
merano99 13-Dec-21 16:48pm View
Since the field starts at 0, the last index should not be larger than (max_size-1).
size = diap("Input size-->", 0, max_size-1)
merano99 13-Dec-21 15:55pm View
The code could fit this project:
A Simple Pie Chart Control - Improved 3-D Pie Chart by PrasadPerera

BOOL CPieChartWnd::Create(LPCTSTR lpCaption, const RECT& rect, CWnd* pParentWnd, UINT nID);

merano99 7-Dec-21 18:04pm View
As I have already written in my solution, this is not C ++ code and that it is rather unsolvable with a stack has already been written.
Please comment on the existing solutions and, if necessary, evaluate.
merano99 6-Dec-21 11:10am View
Displaying a message box with [Afx] MessageBox is a blocking operation, so it is normal.
Are you sure that the dialog is not behind other Windows, e.g. behind the IDE window?
merano99 29-Nov-21 17:21pm View
The input appears to be read from a file. The attempted solution shown here has little to do with the task and is far too little. In addition, there are no specific questions with which one could help.
merano99 29-Nov-21 16:28pm View
Windows that are closed do not generate any more messages. You could just leave the vector element unused.
Before you finally close the window you can of course delete the element from the vector, but you would then have to renumber all remaining windows.
To do this, you would have to write the window handle in the vector. But if this is needed anyway you can save the numbers completely. Simply search for the window handle and use the data under this index element.

merano99 29-Nov-21 16:21pm View

Windows that are closed do not generate any more messages.
Before you finally close the window you can of course delete the element from the vector, but you would then have to renumber all remaining windows.
To do this, you would have to write the window handle in the vector.
But if this is needed anyway you can save the numbers completely. Just find the window handle and use the index of that element.
merano99 28-Nov-21 17:03pm View
Numbering the windows with SetWindowLongPtr () seems to be a good solution if you write a consecutive number after creating the window. It is unclear which information should be stored in data.
merano99 27-Nov-21 6:46am View
Are you shure that this code compiles?
I think several places will not:
reinterpret_cast<char *="">
no.="" "<<acno;
merano99 26-Nov-21 19:53pm View
In addition, it would be much better not to declare data public but rather private.
merano99 26-Nov-21 19:51pm View
I fully agree with you. Before you overwrite the old pointer, you should definitely check whether you don't have to free up the memory beforehand.
merano99 15-Nov-21 18:52pm View
//code the 10 functions that are suppose to be coded ....

If you have tried, where are they?
merano99 13-Nov-21 3:30am View
If you solved it in Java what exactly is the problem. The algorithm will probably not differ much, just the syntax.
We usually expect some visible personal contribution here.
merano99 11-Nov-21 15:53pm View
We would expect there to be a first program framework where some things have already been prepared.
Should it get caught somewhere, we would expect that the problem is described here and explained what does not work as desired and what you actually want.
It would then also be good to ask a specific question here.

What does Page 2 of 6 mean?
merano99 6-Nov-21 13:20pm View
If you accept a variable length list, you cannot hardcode 3.
See my answer on a variable number of elements.
merano99 6-Nov-21 12:56pm View
It seems that the hard coded 3 is the real problem.
Another problem arises when someone enters two words with spaces. It would make sense to read in the entire line with getline.
merano99 6-Nov-21 9:05am View
It definitely works.
Did you assign the return value in main as I suggested?

n = getBankinfo();
merano99 5-Nov-21 21:21pm View
If you had said from the beginning what exactly you are allowed to and what not you could have given better answers immediately.

When you have to use * as reference you have to write:

void displayBankinfo(Bankinfo *n) {
cout << n->name << endl;
merano99 5-Nov-21 19:03pm View
Yes, and in addition, it is better to move all of this to a subroutine.
merano99 4-Nov-21 14:35pm View
As you can see from our discussion below, there is no known C ++ solution to this frequently asked question. Under Windows there are solutions in C that also work under C ++.
merano99 4-Nov-21 14:25pm View
Out of desperation, because at this point it is neither platform-independent nor with "real" C ++.
If you don't like conio like me, I only see the possibility to use system calls directly. Unfortunately, it then becomes quite cumbersome. I also offered the solution here, see there.
I am not aware of any solution with cin that works without <enter>.
merano99 3-Nov-21 18:03pm View
The linked artikel is using <string.h>. It works, but <string> would be the first choice for C ++.
merano99 3-Nov-21 17:48pm View
1. Before delete you have to copy
2. Use memcopy instead of the for loop; that goes much faster
merano99 1-Nov-21 8:32am View
The Russian texts are comments generated by the Russian IDE. For me, German is usually also used in these places.
merano99 31-Oct-21 21:41pm View
The functions drawPoint() and cycle() are not used, variable totalPoints not defined.
Call of drawPoint(100, i, totalPoints) does not match declaration.

Better to use cmath instead of math.h.

#include <cmath>

A timer is probably needed that calls OnDraw regularly by callin e.g. InvalidateRect().
merano99 30-Oct-21 18:50pm View
Better not to use system("pause").


Instead write a function pause() with cin.ignore() and cin.get().
merano99 21-Oct-21 17:54pm View
Why not use

cout << "Enter element " << i << "\n";

Definition of arr is a problem here. In Your Solution this is not solved and
you missed to tell.
merano99 20-Oct-21 16:58pm View
If you only use Visual Studio the solution is ok.
If the lib should also be usable for compilers other than Visual Studio, it would be advisable get rid of name mangling (also name decoration).
merano99 18-Oct-21 17:22pm View
We discussed that yesterday. Havent you seen that?
merano99 18-Oct-21 17:16pm View
Instead of doing an idiot check, it might be better to use data types that avoid this.


int GetDaysInMonth( int year, TYP_MONTH month);
merano99 10-Oct-21 4:22am View
If C++ ist allowed, combine it with the solution from CPallini and you have a nice Solution.
merano99 10-Oct-21 4:20am View
You marked this as C ++, but you are writing pure C code. If C ++ is allowed, the solution from KarstenK would be recommended, otherwise that from CPalini.
merano99 10-Oct-21 4:11am View
In C ++ it is common to use <iostream> instead of <stdio.h>.
merano99 9-Oct-21 4:09am View
I don't see any reason to cross out the entire solution.
The correct spelling of COleDateTime and the link to the documentation are important parts of the solution.
merano99 8-Oct-21 16:30pm View
As you have noticed, it works with a small example, but it is generally unusual and not recommended, as it causes problems with linking in larger projects.

See: What to put in a header file?
merano99 8-Oct-21 14:00pm View
Ok. Then see my solution.
merano99 8-Oct-21 13:54pm View
see my update above
merano99 7-Oct-21 18:17pm View
If I understand the linked documentation correctly, there are COleDateTime Relational Operators

bool operator==(const COleDateTime& date) const throw();
bool operator!=(const COleDateTime& date) const throw();
bool operator<(const COleDateTime& date) const throw();
bool operator>(const COleDateTime& date) const throw();
bool operator<=(const COleDateTime& date) const throw();
bool operator>=(const COleDateTime& date) const throw();
merano99 6-Oct-21 19:17pm View

Are you serious?
merano99 6-Oct-21 19:12pm View
Are you serious?
merano99 28-Sep-21 18:10pm View
merano99 27-Sep-21 18:33pm View
The function pthread_create looks like POSIX. Since you marked the code as Linux, you should link with -lpthread and maybe you need -lm as well.
merano99 27-Sep-21 18:23pm View
Thank you.
merano99 26-Sep-21 19:59pm View
Shouldn't the result be in arr1?
merano99 24-Sep-21 18:49pm View
The approach is correct, but something goes wrong in the lower part.
It could possibly go like this.

// find base tens
if (number > 19) {
base = number / 10; // base = 3 tens
cout << tens[base] << " ";
number = number % 10; // number = 7
// find units up to 19
if (number > 0)
cout << units[number];
merano99 26-Aug-21 11:04am View
Yes, I saw that. But also: Updated 15 hours ago.
And since there was no answer, I decided to suggest something to solve that.

merano99 25-Aug-21 19:22pm View
Show the program you tried and explain where the problem is.
merano99 18-Aug-21 17:58pm View
Yes you are right. The text has been shortened and there is still an open if bracket in the original. I added. I´m not shure what it does. The suggestions in your solution would certainly be clearer.
merano99 16-Aug-21 14:38pm View
The source code at hand is pure C. Why is it tagged as C ++?
merano99 2-Aug-21 20:13pm View
hihi;) intiCount is missing a space: int iCount
merano99 1-Aug-21 18:11pm View
The Titel ist: "How to use a string instead of a hardcoded value"
The file name is in a variable - in a string, and is therefore very easy to change. It was precisely about the remaining conversion problem, which I believe to have elegantly solved here. I don't think the downvotes are justified.
merano99 31-Jul-21 19:21pm View
The best thing to do would be to write don't care code that works with both.
See my Solution.
merano99 31-Jul-21 6:53am View
You ask for "simple marksheet program in c#".
Why do you post this with C and C++ Tags?
Please remove the Tags that you dont mean.
merano99 28-Jul-21 17:12pm View
Essential parts of the source code are missing. It cannot be compiled without knowing the exact declaration for the self-defined data types.

error C2065: "str": undeclared identifier
error C2065: "listNode": undeclared identifier
error C2440: "Initialization": "str" ??cannot be converted to "listNode *"
merano99 28-Jul-21 16:58pm View
Edit controls are designed to either interpret Enter key presses as a new line (in a multiline edit control) or to ignore it. The way would be to subclass the edit control and call SetFocus () there. This then triggers the desired KillFocus message.
merano99 27-Jul-21 18:10pm View
You should add ios :: in as you read., ios::in | ios::ate | ios::binary);
merano99 13-Jul-21 18:35pm View
"I tried all of things but it doesn't work"

Show us what you have tried und tell us what does not work.

To start, you'll take a hello world program, declare some data types, and assign user input. Where is the problem?
merano99 12-Jul-21 15:05pm View
I used VS2015 german version and testet your Problem in InitInstance().

The Call of
SetWindowText( m_pMainWnd->m_hWnd, _T("Hello Wörld!"));

changed the TitleBar of the main window has as expected.

I used the System call here, not the MFC call. Is there a diffence?

Can you post a link to your code?
merano99 10-Jul-21 7:06am View
As I wrote hours ago, the file is not read at all. See my solution below.
merano99 1-Jul-21 19:26pm View
It is not clear where exact the problem is. We do not have the files "connec.txt" and "mesh.txt" and the compiler does not see errrors.
merano99 30-Jun-21 17:47pm View
To access HKLM (HKEY_LOCAL_MACHINE) you need admin rights, e.g. elevate your application using UAC. You can also allow access to the Key by editing the permissions on the relevant registry key.
merano99 23-Jun-21 18:36pm View
Code has several warning and space for better

1. // missing header
#include <string>
2. // convert string toupper
string type; cin >> type;
for (auto & c : type) c = toupper(c);
2. // conversion problems
par = lround((work[coun] - 40) * 1.5*fixed[coun]); // round
3. // variables not initialised
int coun = 0;
merano99 11-Jun-21 18:57pm View
You are asking for a solution for Arm assembler but you also propose various Intel assembler solutions. The difference is obvious, but it doesn't seem clear to you. A little more preparatory work would be necessary here.
Solution one, three and four even seem to come from the DOS era, that was a long time ago and makes little sense here ...

Why this was marked with C and C ++ here is also not clear to me.
merano99 10-Jun-21 20:19pm View
"set it to the appropriate value for the condition of not raining ..."
You screwed up.
merano99 7-Jun-21 19:43pm View
Wondering why there is old C Code in this C++ Program.
Would expect:

typedef std::deque<char> ListNode;

class Solution {
Solution(std::string text);
bool lsPalindrome();
ListNode _head, _reversed;
merano99 31-May-21 18:22pm View
What is "libraries.h" ?
merano99 29-May-21 15:22pm View
You're right, but the original question has recently been changed. That made her stand up again. Thanks for the hint.
merano99 27-May-21 19:23pm View
If you change to char *find_char(char c, const char *s)

C Compiler says:
warning C4090: "return": different "const" qualifiers

C++ Compiler says:
error C2440: "return": "const char *" can not converted to "char *".
merano99 20-May-21 19:43pm View
error C2065: "greater": undeclared identifier
With other header would work for me.
// #include <algorithm>
#include <functional>

Note: A set cannot store duplicates. Ignoring duplicates was not required here.
merano99 19-May-21 14:30pm View
Maybe some invisible characters in line 4. Copy the text into a simple editor (notepad or something similar) and save it again.
merano99 10-May-21 16:21pm View
It was intended as an addition to your approach, not a correction.
merano99 9-May-21 18:32pm View
When it ppsn is an char-array following is also not korrekt:
int checkPpsn(int ppsn)

Some datatypes should better be integer.
Effort and performance in the string comparison are not optimal.

Another point is the use of unsafe functions that are no longer common these days.
If you dont care use #define _CRT_SECURE_NO_WARNINGS
merano99 7-May-21 19:40pm View
The Compiler reports several problems, but at least it runs with 32Bit. First is that glut.h is not found. Ich used freeglut.lib instead. Missing braces, and Codelines, that make no sense like: "sprintf(text, "WHERE THERE IS A WILL THERE'S A WAY", 5.00, 8.00);"
I compiled with Visual-Studio and there are many warnings saying "Shortening of "double" in "GLfloat""
At least it runs and shows a grafic screen. See no reason why it should not work in principle.
merano99 6-May-21 1:27am View
As Richard wrote, this are at least 4 different things.

Programming a PIC microcontroller (16/32 Bit) in C is common.
But it is very different from a C program that you can use for a System with operating system. One needs knowledge of the architecture and accesses hardware directly.

Developing the hardware yourself requires electronic knowledge. One creates circuit diagrams and layout, orders the circuit board or do that yourself.

Then you have to assemble the components. Good soldering skills are required for this
and measuring devices as well as knowledge of components and how to find defects.

If you want to connect the finished circuit to the PC, that stays nowadays only the USB interface.

If you don't want to write a driver yourself, it makes sense to make it HID-compatible. Just set the clock in the PIC for USB correctly is quite a task.

Accessing the USB interface on the PC side works with many Programming languages. If you wanted to stay close to the hardware there too ISO C ++ certainly not a bad choice.

I have already realized these things in exactly the same way many times.

Whereby I usually order the SMD board, because you can hardly do it yourself with PICs that have many connections and I also want to avoid working with acid.

To start with, I would recommend buying a ready-made PIC-based demo board with a USB interface.

Then you can deal with the programming and gain experience with the hardware.

If you try everything at the same time, with some certainty nothing will come of it in the end.
Alternatively, you could form a team and split the work.

merano99 6-May-21 0:50am View
You still did not get this right: "for(int n=1; .."
If you start at 1 or 0 you should count up, not down.
merano99 5-May-21 18:16pm View
Your for loop "for (int i=1; i<=n; i--)" is wrong.
Init i with n and compare with 0.
Alternative increment i if yo plan to count other direction.
merano99 5-May-21 18:10pm View
Instead of writing

cout << "Give 1st num: "; cin >> x;
cout << "Give 2nd num: "; cin >> y;

think about writing a method arith::getinput()
merano99 5-May-21 18:07pm View
Look at my answer to your question before:
merano99 4-May-21 17:36pm View
I seems a good hint to solve the problem. The questioner asked what logic is behind the problem and the answer seems appropriate.

merano99 3-May-21 19:05pm View
Does not compile with Visual-Studio

1. xxx.cpp(87): error C2065: "wtime": not declared
2. xxx.cpp(247): warning C4477: "printf": ... Typ "int **" (several warnings)

Are you really shure you want a loop with id?
merano99 28-Feb-21 17:55pm View
"the task was to modify our code so the user can input as many numbers as they can"

Not shure, if scanf("%d", &digit) can realy do this. What happens if you type more than a long can handle?

There are some more errors in the code. e.g. count[digit > 0] does strange things.

I tried "2223334445566677888999222222222441345436257676776573" in VS and the result was -1. The code does not work for digits that are to much.
Better use a loop, read chars and count them.
merano99 23-Feb-21 18:42pm View
On 32 Bit Operatin Systems you get a limit at 4GB (2^32). And you probably can allocate more Memory than you have. The OS will swap memory.
merano99 23-Feb-21 18:34pm View
Dont know if it possible in C#. In C or C++ you could check the arguments and if they dont fit exit the process without opening a window at all.
merano99 19-Feb-21 19:49pm View
Every x86 Prozessor starts in Real-Mode. The use of BIOS-Interrups works and you dont need to switch. Why is ist nessarary to switch?
After switching to Protected Mode you can emulate the Real Mode by switching to Virtual 8086 Mode to access BIOS-Interrups. From Protected Mode you have to Reset the CPU to come back to Real-Mode.

Perhaps this is usefull:
merano99 12-Feb-21 19:22pm View
Perhaps this will help to begin
Accessing Pixels with CreateDIBSection
merano99 19-Jan-21 11:55am View
The linked tutorial is really bad.

"conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output.[1] It is not part of the C standard library or ISO C, nor is it defined by POSIX."
Better never use it - neither for C nor for C ++

Why declare Id and Age as int?
Is it usefull to reach neagtiv?

Why declare name as "char Name[25]"?
Would expect string here.
merano99 14-Jun-20 9:54am View
This is what i found in Microsoft Hardware-Dev-Center:

Customize the Windows performance power slider

There is no way ... from the UI, although it is possible from the cmd line (via powercfg).

Slider availability
The Windows power slider is available for AMD and Intel platforms running Windows 10, build
1709 and newer builds of Windows. It is not available on devices with ARM64 processors.
The slider will appear on a device only when the Balanced power plan, or any plan that is
derived from Balanced, is selected. There is not an option for either users or OEMs to remove
the slider UX.
merano99 16-Jan-20 18:27pm View
Isn't the delete to the free missing?
merano99 2-Jul-19 15:48pm View
The playgame method can be improved too:
void playgame() {
  std::string input;

  while (true) {
	puts("Go player one");
	getline(std::cin, input);
	if (input != "") {
		int index = std::stoi(input) - 1;
		if ((index >= 0) && (index <= 8)) {
			int row = index / 3;
			int col = index % 3;
			char grid_position = map[row][col];
merano99 10-Dec-14 17:15pm View
Does it help to set HBRUSH to 0, not RGB ?