_snprintf

This is a discussion on _snprintf within the Windows Programming forums, part of the Platform Specific Boards category; I have some code Code: char szSub[255]; _snprintf( szSub, sizeof szSub, "SQ.%s. .CSCO", m_szPart ); where Code: char m_szPart[255]; I ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    31

    _snprintf

    I have some code

    Code:
           char szSub[255];
    
    	_snprintf(	szSub, 
    		sizeof szSub, 
    		"SQ.%s. .CSCO",
    		m_szPart 
    		);
    where
    Code:
    char m_szPart[255];
    I want to change this function so I pass in a string which is used to build the string that is being built here. For instance...
    rather then CSCO in SQ.%s. .CSCO I could pass in MSFT and SQ.%s. .MSFT would be built. How could I do this?
    Last edited by mhandlon; 04-10-2006 at 07:49 AM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    Learn about cross-posting
    _snprintf
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21