简体   繁体   中英

visual studio 2012 c++ error

I just started to learn c++ and I wanted to show an arry in promt but i get this weird error

this is my code:

#include "stdafx.h"
#include "conio.h"
#include <iostream>
using namespace std;

void _show(char a[10][10])
{
    int i,j;
    for(i=0;i<10;i++)
        for(j=0;j<10;j++)
            cout<<a[i][j];
}
void _main(int argc, _TCHAR* argv[])
{
    char a[10][10];
    int i,j;
    for(i=0;i<10;i++)
        for(j=0;j<10;j++)
            a[i][j]=0;
    _show(a);
}

and this is the error:

Error 1 error LNK2019: unresolved external symbol _main referenced in function

Error 2 error LNK1120: 1 unresolved externals

Your program is missing "main" function (which is used as entry point from OS). This function MUST have name: int main(int argc, char * argv[]) (for classic console based application)

Don't use underscores here is an explanation why as they are reserved

main function should be declared as

int main(int argc, char *argv[])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM