Apr 30, 2014 at 8:07pm UTC
Can someone please help me? I recently started "advanced" c++.
Can someone help me with my problem?
Expected initializer before 'float'
can you fix the problem? or tell me hwo to fix it
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
float veritces;
float vertices[] = {
0.0f, 0.5f, // Vertex 1 (X, Y)
0.5f, -0.5f, // Vertex 2 (X, Y)
-0.5f, -0.5f // Vertex 3 (X, Y)
};
Last edited on Apr 30, 2014 at 8:24pm UTC
Apr 30, 2014 at 8:13pm UTC
different data types with same ID? this is not possible in C++.
Aceix.
Apr 30, 2014 at 8:50pm UTC
If that is the exact code you are missing curly braces around Main
Apr 30, 2014 at 11:03pm UTC
I may be taking this the wrong way, but either it is a prototype or a function/method header:
1 2 3 4 5 6 7 8 9 10
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{//This Was Missing?
float veritces;
float vertices[] = {
0.0f, 0.5f, // Vertex 1 (X, Y)
0.5f, -0.5f, // Vertex 2 (X, Y)
-0.5f, -0.5f // Vertex 3 (X, Y)
};
}//This Was Missing?
My bet's on header of a function.
Last edited on Apr 30, 2014 at 11:03pm UTC