argc and argv problem

Declan McMullen declan.mcmullen at gmail.com
Thu Apr 24 10:23:38 PDT 2008


I might be wrong but doesnt %d mean double? argc will be an int
Also argv[0] will give you back a wxString i think.

I use argc and argv in a program without a problem so far:

bool MyApp::OnInit()
{
    if(argc !=3D 2)
       //dostuff

     wxString arg =3D argv[1];
        if(arg.Cmp(wxT("0")) =3D=3D 0)
           //dostuff

}



>
> MyApp::MyApp() :
>        wxApp()
> {
>        printf("argc =3D %d\n",argc);
>        printf("argv[0] =3D %s\n",argv[0]);
> }
>
> When I run the debugger and try to print argc,
> it says:
>
> No symbol "argc" in current context.
> the argv line SEGV's for the same reason.
>
> Im using this under Linux, but it shouldnt matter.
>
> Can someone tell me what Im doing wrong?
> Thanks,
> Jeff
>
>
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
>



-- =

http://www.computing.dcu.ie/~dmcmullen
declan.mcmullen at computing.dcu.ie
School of Computing
Postgrad Bay A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080424/357=
d624e/attachment-0001.htm


More information about the wx-users mailing list