Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ELS1

newbie: instr, mid, right, etc. in c?

This topic is 6040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im just learning c...and im having trouble with string formating. is there any built in c functions that all you to do this? as you can see, i come from the VB world :D Any help or pointers will be appreciated!

Share this post


Link to post
Share on other sites
Advertisement
  

int i = 2;
char string[] = "hello";
char dst[256];

sprintf(dst, "This is an int %i, This is a string %s", i, string);

Dst will now contain "This is an int 2 this is a string hello"


--------------------------

Those who dance are considered insane by those who cannot hear the music.

Share this post


Link to post
Share on other sites
There''s not an equivilant to instr (that im aware of), but you could
easily write a function that would be equivilant..
just break it down into parts and return the correct value, pretty simple...
same thing with right, left, mid, ect...

-eldee
;another space monkey;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Go to the bookstore. Look at the books on C.
Find one that shows how to do nearly every built-in function.
Buy the book. Look up what you want in the string section.
Have a nice day.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Go to the bookstore. Look at the books on C.
Find one that shows how to do nearly every built-in function.
Buy the book. Look up what you want in the string section.
Have a nice day.


im sorry...but your sarcastic remarks make you sound like an a55hole :D

Share this post


Link to post
Share on other sites
Actually, C++: The Complete Reference Third Edition does a pretty good job of it. It separates everything C from the added C++ stuff too so you''ll only get the C part if that''s what you want.

No, HTML is not an OO language.

Share this post


Link to post
Share on other sites
I was the ap a55hole. (Another reason to keep ap posting!)

And now that I've read my post, by the end
I think you can go ahead and replace the 5's with s's and
tack on another modifier if you so desire.

So what about masonium, he suggests the same thing.
Actually, my advice is better because he just tells you
what to buy, my advice gives you more range and more
importantly, you can use the book later. My advice also
will lead to a more deeper understanding as the alternative
to my advice is to write them yourself and learn more about
how computers work. Sob...Sob...All I try to do is help
and this is the thanks I get??!! LOUD CRYING

Anyway, what was sarcastic about my remarks, aren't we
programmers? Aren't you?

Although I suppose my post was a bad one, you came here to
find advice because you couldn't come up with the idea to
either buy a book or look it up on an online reference and
I was too lazy to hand the functions to you and told you
to do something for yourself. Shame on me. Bad Boy! (Smack!)

I'm so glad the internet came along, my family says I've
got a big mouth and will one day get the tar beaten out of
me and they just might be right.

Certainly don't let my remarks get to ya, I've looked at your
profile and other posts you've made and you seem to be doing
some pretty nice projects.

Sound 'like' an a55hole, whatever happened to my gift?

Create.
Liv Tyler makes a really great elf.

Edited by - RolandofGilead on January 1, 2002 2:56:43 AM

Share this post


Link to post
Share on other sites
sorry...i was kinda pissed because my cousins are over my house and they are getting on my last nerve! NOW GIVE ME A HUG lol

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!