I am working on a pack of Batch File utilities; however, one of them I have been having trouble with. I can't seem to get an input from the command line (Or batch file...) to my C++ program to make it change text color, I can't see where I went wrong in my code, it is very very simple... anyways the problem is that when I get an input and put it through the SetConsoleTextAttribute() function, it has the same output, the text is gray with a purple background, regardless of the input. Any help is much appreciated...
Code:
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <string>
#include <Windows.h>
int main(int argc, char* argv[] = (char**)"4")
{
int c = (int)argv;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c);
std::cout << "Hi!" << std::endl;
system("pause");
}