![]() |
| | #1 |
| Programming is fun, mkay? Join Date: Oct 2001
Posts: 490
| class P { public: void setp(GLfloat x, GLfloat y); private: GLfloat p1x; GLfloat p1y; }; P PDAT[2]; void P::setp(GLfloat x, GLfloat y) { p1x = x; p1y = y; } PDAT[0].setp(0.0f, 0.0f); When I do this, it returns: 33 w32p3d.cpp syntax error before `.' Why does it do this?
__________________ Website(s): http://www16.brinkster.com/trifaze/ E-mail: trifaze_mattu@lycos.com --------------------------------- C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1 DirectX Version: 9.0b DX SDK: DirectX 8.1 SDK |
| SyntaxBubble is offline | |
| | #2 |
| Registered User Join Date: Aug 2001
Posts: 14
| You cannot call a function from a global position in your code. Put PDAT[0].setp(0.0f, 0.0f); inside main() or some other function and it will most likely work. |
| Laos is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ten Errors | AverageSoftware | Contests Board | 0 | 07-20-2007 10:50 AM |
| Unknown Errors in simple program | neandrake | C++ Programming | 16 | 04-06-2004 02:57 PM |
| Stupid compiler errors | ChrisEacrett | C++ Programming | 9 | 11-30-2003 05:44 PM |
| Help me with these errors... :-( | major_small | C++ Programming | 6 | 09-07-2003 08:18 PM |
| errors in class(urgent) | ayesha | C++ Programming | 2 | 11-10-2001 06:51 PM |