Error code C2447 help please ill thanks

Posts 1–15 of 27 · Page 1 of 2
Error code C2447 help please ill thanks
okay.... when i build my project this is my error code
Code:
1>------ Build started: Project: Basics, Configuration: Debug Win32 ------
1>  Basics.cpp
1>c:\users\owner\documents\visual studio 2010\projects\basics\basics\basics.cpp(9): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\owner\documents\visual studio 2010\projects\basics\basics\basics.cpp(24): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
okay anyone know how to get make the errors go away?

idkk if i should put the code in here cause theres some noobs that will copy and paste :X

but if its necessary just tell me and i will
Post your code.

It tells you you're missing '{' somewhere.
Code:
#include <windows.h>
#include <stdio.h>
#include <cstdio>
#include <fstream>
#include <d3d9.h>
#include <d3dx9.h>


{
    D3DCOLOR xcolor = D3DCOLOR_ARGB( 255, 0, 0, 255 );
                                
    int size = 13, strong = 1;
    int iCenterX = GetSystemMetrics( 0 ) / 2;
    int iCenterY = GetSystemMetrics( 1 ) / 2;
    if( iCenterX < 20 && iCenterY < 20 )
    {
        iCenterX = ( GetSystemMetrics( 0 ) / 2 );
        iCenterY = ( GetSystemMetrics( 1 ) / 2 );
    }
    D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
    D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
    pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0,  0);
    pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0,  0);
}
noobs will copy paste? You're a copy paster urself if you're too retarded to find the missing { o__O
Not trying to be mean or anything but...Let's just put it this way: if you supposedly wrote that yourself as you claim you did, you should know where your problem is since anyone reading chapter 1 of C++ for dummies would be able to tell you where the obvious issue is...

If you can't see the problem with the code you posted I sincerely recommend you get a C++ book/tutorial something and start at the BEGINNING

*shakes head and walks away* what is this world coming to....

I'll give you a hint though.. ever heard of functions? methods?
Quote Originally Posted by B1ackAnge1 View Post
Not trying to be mean or anything but...Let's just put it this way: if you supposedly wrote that yourself as you claim you did, you should know where your problem is since anyone reading chapter 1 of C++ for dummies would be able to tell you where the obvious issue is...

If you can't see the problem with the code you posted I sincerely recommend you get a C++ book/tutorial something and start at the BEGINNING

*shakes head and walks away* what is this world coming to....
im trying to learn.... im making this into a career,if it goes anywhere.... im going to take a carer prep center class for coding..... but thats in later on but can someone just tell me where you fix this answer?
uhhhh i didnt copy and paste.....
Looks like you're trying to make an XHair?
yeah just trying to learn and you guys are hurting my feelings >:O
Download the Tatnium D3D Starterkit and put this in EndScene then try it.

Code:
bool TestXHair = false;

if( TestXHair )
{
    D3DCOLOR xcolor = D3DCOLOR_ARGB( 255, 0, 0, 255 );
                                
    int size = 13, strong = 1;
    int iCenterX = GetSystemMetrics( 0 ) / 2;
    int iCenterY = GetSystemMetrics( 1 ) / 2;
    if( iCenterX < 20 && iCenterY < 20 )
    {
        iCenterX = ( GetSystemMetrics( 0 ) / 2 );
        iCenterY = ( GetSystemMetrics( 1 ) / 2 );
    }
    D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
    D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
    m_pD3Ddev->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0,  0);
    m_pD3Ddev->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0,  0);
}
if( GetAsyncKeyState( VK_NUMPAD1 ) &1 ) { TestXHair = !TestXHair; }
You didn't declare pDevice and you need a main function, unless it's a DLL... I think.
i put it at the end and the stupid "{" (the first one) is still underlined red....
i already had d3d starterkit
I appreciate you trying to learn - really I do, however:
most people when trying to learn something new start with the basics and don't just jump into something they 'want' or find interesting.. if you start to learn how to play guitar or piano, you're not going to be playing Steve Vai, or Mozart right away, you start with stupid simple stuff. Same with programming - you start with the basic concepts, you don't just jump into Hacking, D3D etc.

If you don't even know that you need to have functions (or even a main function like david above me mentioned) to put your code in, let alone how to write one from scratch I AGAIN highly suggest you take a break from whatever project you're wanting to work on, and start with Hello world, adding 2 numbers, or other SIMPLER programs until you can do those in your sleep. Then once you understand the concepts of how a C++ program is even supposed to be structured you can move on to the more 'fun' projects..

Otherwise what's gonna end up happening is the only way your project would be 'fixed' is where 'we' write everything for you, you copy & paste it, hit compile and go off saying 'you' wrote something while really you didn't etc etc and if you have read some of the other threads, we really frown upon that type of behavior. And i could tell you: Put this here and that there, but what does that do for you? Nothing since you'll have no idea WHY you had to make the change.

On the flipside, we always encourage and help out people who are truly trying to learn how to program C++ / C / ASM etc who have intelligent questions.

Anyway, Not even knowing what a (main) function is and why it's required, which is usually explained on page 1 or 2 of any C++ book/tuturial unfortunately comes across as someone who does NOT want to learn, but wants to leech. If that's not the case, then make the effort to learn things properly

Again - not trying to be a dick - but that's how it is.
okayy but when i did the hello world it wouldnt work i have 2010 is that different from 2008? thats why i need a "cracked" version of one


-i used my trail up.
If you try "Hello World" and it doesn't work, it means you don't actually know what you're doing.

[php]
#include <iostream>

int main()
{
std::cout << "Hello World!";
cin.get();
}
[/php]
Posts 1–15 of 27 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?