Jump to content

[SOLVED] 2 C++ related questions


Recommended Posts

1) I have been studying/playing with C++ for awhile.  However I have always been curious how to go above and beyond command line applications (which is all I can write currently) and start developing windows applications (and eventually making them compatible with MAC, Unix, and Linux).  Basically this is the general code below i have seen in a variety of places.

However this code throws a variety of errors..is there a way to make this code work.

int WINAPI WinMain(HINSTANCE hInstance,
	   HINSTANCE hPrevInstance,
  		   LPSTR lpCmdLine,
  		   int nCmdShow);

[errors]

1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2146: syntax error : missing ';' before identifier 'WinMain'

1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2065: 'HINSTANCE' : undeclared identifier

1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2146: syntax error : missing ')' before identifier 'hInstance'

1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(4) : error C2059: syntax error : ')'

[/errors]

 

2) What is the difference between a "Struct" and a "Function" in C++. I have seen a few examples where Struct is used instead of Function?

Link to comment
https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.