Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: vonLandenhausen on November 18, 2004, 01:29 PM

Title: placeholders
Post by: vonLandenhausen on November 18, 2004, 01:29 PM
i know that %d is for interger, %X for hexadecimals and i think that %ld is for long integers. but what do i use for strings/CStrings ? i already searched with google but didnt getany help. btw, is "placeholder" the right word that stuff above ? help please
Title: Re: placeholders
Post by: vonLandenhausen on November 18, 2004, 01:32 PM
come on. im waiting  :'(
Title: Re: placeholders
Post by: UserLoser. on November 18, 2004, 01:34 PM
%s?


printf("Hello my name is %s!\n", mystring);
Title: Re: placeholders
Post by: Mephisto on November 18, 2004, 01:58 PM
Quote from: vonLandenhausen on November 18, 2004, 01:32 PM
come on. im waiting  :'(

::)

%s - C-style NULL terminated strings
You cannot print std::string with cstdio; use iostream objects to do that.
Title: Re: placeholders
Post by: Skywing on November 18, 2004, 02:00 PM
You could use %s/%ws with c_str() for most basic_strings...
Title: Re: placeholders
Post by: vonLandenhausen on November 18, 2004, 02:33 PM
thx alot. does anyone know where to find a table with all the other placeholder variables? i was looking for that for 30min ¬_¬
Title: Re: placeholders
Post by: Arta on November 18, 2004, 02:50 PM
I'm not usually so curt, but.. you really need to RTFM.
Title: Re: placeholders
Post by: Skywing on November 18, 2004, 02:55 PM
Yes.  This is trivial to find if you look up printf in any reference manual.
Title: Re: placeholders
Post by: MyndFyre on November 18, 2004, 04:18 PM
Quote from: vonLandenhausen on November 18, 2004, 01:32 PM
come on. im waiting  :'(

You also need to stop trolling.  People will get to you when they can get to you.
Title: Re: placeholders
Post by: Banana fanna fo fanna on November 18, 2004, 06:26 PM
1:29 - first post
1:32 - second post

I don't think I'm ever going to help you, and I hope no one else does, either.
Title: Re: placeholders
Post by: Mephisto on November 18, 2004, 08:57 PM
Quote from: Banana fanna fo fanna on November 18, 2004, 06:26 PM
1:29 - first post
1:32 - second post

I don't think I'm ever going to help you, and I hope no one else does, either.

Same; I'm getting pretty fed up with him.
Title: Re: placeholders
Post by: vonLandenhausen on November 19, 2004, 04:03 AM
Quote from: Mephisto on November 18, 2004, 08:57 PM
Quote from: Banana fanna fo fanna on November 18, 2004, 06:26 PM
1:29 - first post
1:32 - second post

I don't think I'm ever going to help you, and I hope no one else does, either.

Same; I'm getting pretty fed up with him.
;D im not as elite as you guys are. but nobody is perfect k?
Quote from: Arta[vL] on November 18, 2004, 02:50 PM
I'm not usually so curt, but.. you really need to RTFM.
hey mate, i dont have a fucking manual for my vc++6 compiler :D
Title: Re: placeholders
Post by: dxoigmn on November 19, 2004, 08:08 AM
Quote from: vonLandenhausen on November 19, 2004, 04:03 AM
hey mate, i dont have a fucking manual for my vc++6 compiler :D

You don't need a manual for the compiler, rather a manual for the language.  I'd recommend The C Programming Language by Kernighan & Ritchie.
Title: Re: placeholders
Post by: vonLandenhausen on November 19, 2004, 09:45 AM
RTFM = Read the fucking manual
Title: Re: placeholders
Post by: Zakath on November 19, 2004, 09:46 AM
Yes, we know. That's what we've been subtly (and not-so-subtly) trying to get you to do.
Title: Re: placeholders
Post by: Arta on November 19, 2004, 12:13 PM
Quote from: vonLandenhausen on November 19, 2004, 09:45 AM
RTFM = Read the fucking manual

So download one. What do expect us to do, spoonfeed you your program line by line?
Title: Re: placeholders
Post by: Banana fanna fo fanna on November 19, 2004, 07:56 PM
manual == documentation, retard.