Original Post
🔒 Locked
left(string,2)
Advertisement
ummm, whatever "left" means. i''m going to assume you are talking about left justifying a string.
here''s the left justify method from my own string class. i removed the actual references to the class.
ohh, and there is no "left justify" function in the ANSI C library. i couldn''t tell you about ANSI C++ or MFC as i don''t use them, but you might want to check them out.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
here''s the left justify method from my own string class. i removed the actual references to the class.
|
ohh, and there is no "left justify" function in the ANSI C library. i couldn''t tell you about ANSI C++ or MFC as i don''t use them, but you might want to check them out.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
Actually left takes everything from the left side of the string up to a specified number.
I would do something like:
memcpy(dest_string, src_string, chars_to_copy);
Invader X
Invader''s Realm
I would do something like:
memcpy(dest_string, src_string, chars_to_copy);
Invader X
Invader''s Realm
I''m not sure, but is it possible that some of those equivalents need to be testing for whether the string is too short?
so: Left$("Hi", 3) should return "Hi" (which is the behaviour with the VB Left$
(also, note the $ sign, if you were going to do the C++ version of Left, it returns a VB variant which is poo)
Trying is the first step towards failure.
so: Left$("Hi", 3) should return "Hi" (which is the behaviour with the VB Left$
(also, note the $ sign, if you were going to do the C++ version of Left, it returns a VB variant which is poo)
Trying is the first step towards failure.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement
