Valhalla Legends Forums Archive | C/C++ Programming | placeholders

AuthorMessageTime
vonLandenhausen
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
November 18, 2004, 7:29 PM
vonLandenhausen
come on. im waiting  :'(
November 18, 2004, 7:32 PM
UserLoser.
%s?

[code]
printf("Hello my name is %s!\n", mystring);
[/code]
November 18, 2004, 7:34 PM
Mephisto
[quote author=vonLandenhausen link=topic=9598.msg89273#msg89273 date=1100806365]
come on. im waiting  :'(
[/quote]

::)

%s - C-style NULL terminated strings
You cannot print std::string with cstdio; use iostream objects to do that.
November 18, 2004, 7:58 PM
Skywing
You could use %s/%ws with c_str() for most basic_strings...
November 18, 2004, 8:00 PM
vonLandenhausen
thx alot. does anyone know where to find a table with all the other placeholder variables? i was looking for that for 30min ¬_¬
November 18, 2004, 8:33 PM
Arta
I'm not usually so curt, but.. you really need to RTFM.
November 18, 2004, 8:50 PM
Skywing
Yes.  This is trivial to find if you look up printf in any reference manual.
November 18, 2004, 8:55 PM
Myndfyr
[quote author=vonLandenhausen link=topic=9598.msg89273#msg89273 date=1100806365]
come on. im waiting  :'(
[/quote]

You also need to stop trolling.  People will get to you when they can get to you.
November 18, 2004, 10:18 PM
St0rm.iD
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.
November 19, 2004, 12:26 AM
Mephisto
[quote author=Banana fanna fo fanna link=topic=9598.msg89308#msg89308 date=1100824009]
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.
[/quote]

Same; I'm getting pretty fed up with him.
November 19, 2004, 2:57 AM
vonLandenhausen
[quote author=Mephisto link=topic=9598.msg89325#msg89325 date=1100833054]
[quote author=Banana fanna fo fanna link=topic=9598.msg89308#msg89308 date=1100824009]
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.
[/quote]

Same; I'm getting pretty fed up with him.
[/quote]
;D im not as elite as you guys are. but nobody is perfect k?
[quote author=Arta[vL] link=topic=9598.msg89284#msg89284 date=1100811006]
I'm not usually so curt, but.. you really need to RTFM.
[/quote]
hey mate, i dont have a fucking manual for my vc++6 compiler :D
November 19, 2004, 10:03 AM
kamakazie
[quote author=vonLandenhausen link=topic=9598.msg89355#msg89355 date=1100858581]
hey mate, i dont have a fucking manual for my vc++6 compiler :D
[/quote]

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.
November 19, 2004, 2:08 PM
vonLandenhausen
RTFM = Read the fucking manual
November 19, 2004, 3:45 PM
Zakath
Yes, we know. That's what we've been subtly (and not-so-subtly) trying to get you to do.
November 19, 2004, 3:46 PM
Arta
[quote author=vonLandenhausen link=topic=9598.msg89369#msg89369 date=1100879114]
RTFM = Read the fucking manual
[/quote]

So download one. What do expect us to do, spoonfeed you your program line by line?
November 19, 2004, 6:13 PM
St0rm.iD
manual == documentation, retard.
November 20, 2004, 1:56 AM

Search