05-31-2003, 01:06 PM
whats the equivelent on mid$ in c and/or c++? Its really pi$$ing me off trying to find it! :normal:
mid$ in c
|
05-31-2003, 01:06 PM
whats the equivelent on mid$ in c and/or c++? Its really pi$$ing me off trying to find it! :normal:
05-31-2003, 01:55 PM
Quote: Keep in mind that strstr("qbasic programming is cool", "is") will return a pointer to the I in "is", so if you print it you'll see "is cool": cout<<strstr("qbasic programming is cool", "is"); // prints "is cool" If you just want the "is", you'll have to make sure to copy out only 2 characters into a new string and then add on a NULL to terminate it.
05-31-2003, 07:03 PM
You do know, that in c you can simply to
Code: printf("%c",string[numberhere]);
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror] Stop Double Posts! Whats better? HTML or Variables?
05-31-2003, 09:28 PM
thanx hard rock. I never would of thought of that.
05-31-2003, 09:57 PM
Bare with me, my knowledge of C is slim to null.
If you combine the 2 of those, I think you can do this: Quote:string = "string name"; Although I just realized that that's useless, since all it does is basically prints out searchstring for you but the concept is still there.
earn.
05-31-2003, 10:31 PM
lith helped me make a mid$ sub for plain string byte arrays for ante87 once (i've lost my icq logs since), but i believe in most standard string classes there's an equivalent called "substr"
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
06-01-2003, 12:44 AM
Ive got what i wanted now thanx guys. that sub string you metion toonski gave me $hit. It was what popped up when I googled for a "c substring function".
It's ment to be: variblename.substr(start, length); but it brought up errors when I compiled! and yes, I did include <string,h> (which is useless cause substr isnt defined in there :lol: ). It must be in some other header file....
06-11-2003, 05:30 AM
if your using C++, you can just use the string class, i.e.:
Code: // example using the C++ string class hope that helps
COUNT HACKED BY RAZVEEE
RAZVEE IS A SCRIPT KIDDIE- hacker9
06-14-2003, 06:27 AM
Quote:Hope that helps, you dont need mid in c becuase you can access anyof the string at will.(and with this, it should be VERY easy to write your own, using sizeof() to calculate size of the sting) I didn't think you could use sizeof... wouldn't you use strlen?
06-14-2003, 06:34 PM
SizeOf() should work, too, because every string in C/C++ is an array of bytes....
B 4 EVER
|
« Next Oldest | Next Newest »
|