I was trying to make a string search from an array..
look at this....
int TotalBadStrings = 3;
// START INFINITE SCANNING!
while(true)
{
for (int BadStringsCount = 0; BadStringsCount < TotalBadStrings; BadStringsCount++)
{
char* StringsToSearch[] = {"badstring1", "badstring2"};
char *lpData = (CHAR*)GlobalAlloc(GMEM_FIXED, MAX_READ),
lpOrig[] = StringsToSearch[BadStringsCount];
// HERE I MAKE A SCAN IN MEMORY USING lpOrig
}
When i try to compile i get this
[Error] initializer fails to determine size of 'lpOrig'
214 54 [Error] array must be initialized with a brace-enclosed initializer
The problem is when I try to get one of the strings from my array StringsToSearch
I am using DEV C++ 5.6.1 with GCC 4.8.1 32 bits
Any idea? thank you in advance!
char *to point to a string literal. You're better off just usingstd::stringanyway.