V
V
Vadim kyklaed2018-02-18 21:32:30
C++ / C#
Vadim kyklaed, 2018-02-18 21:32:30

Is there a memory leak here?

Hello, here is a small program that makes the hotkey I need, the problem is, does it have a memory leak? but I doubt because I do not allocate memory dynamically.
The problem is that my program loads the percentage by 30-40%, and when it is necessary it does not work out. although everything is ok with it. if you restart it, then everything works.

#include <iostream>      
#include <windows.h>
#include <winuser.h>
 
using namespace std;
 

int main(int argc, char **argv)
{
  ShowWindow(GetConsoleWindow(), SW_HIDE); 
  char q;
  while(1){ 
    	for(q=8;q<=190;q++) 
    	{
           if(( GetAsyncKeyState(VK_CONTROL) & 0x11) && (GetAsyncKeyState(VK_F12) & 0x7B)) { 
           		system("shutdown -l -f");
       }
       }  
    }
  return 0; }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question