home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,647 of 243,242   
   Michael Sanders to All   
   Re: srand(0)   
   31 Dec 25 03:28:03   
   
   From: porkchop@invalid.foo   
      
   On Wed, 31 Dec 2025 03:10:52 -0000 (UTC), Lawrence D’Oliveiro wrote:   
      
   > Clearly on Windows, there are no guarantees about argc contains, so   
   > you shouldn’t be relying on it.   
      
   Some windows snippets:   
      
   int main(int argc, char **argv); // subsystem (text-mode)   
      
   int wmain(int argc, wchar_t **argv); // gui   
      
   And to muddy the waters further (what I tend to use)...   
      
   #include    
   #include    
      
   int main(void) {   
      
       LPSTR cmd = GetCommandLineA();   
      
       printf("Raw command line:\n%s\n", cmd);   
      
       return 0;   
   }   
      
   c:\> app.exe foo "bar baz" 123   
   "app.exe" foo "bar baz" 123   
      
   --   
   :wq   
   Mike Sanders   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca