Thread: function

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    77

    function

    is there any function for mi to filter a string like "makniaf19"
    i wan to like filter the words and the number to two different variable

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    No, not a standard function. But you can write one that would read the string in character by character and based on where it finds a number you can extract that portion out, then use itoa()/ltoa() to convert it and then load it into your numerical variable. Then extract the remaining portion of the string into your new char variable.

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    77
    becoz im using the CString function so i cannot use the itoa() funtion
    or is there way for mi to check for every words in the sentence??

  4. #4
    Unregistered
    Guest
    If you want to use CString(and I think you should it is very easy and powerfull) You need to look through the methods used to work with CString. There are plenty of ways to get CString to do what you want..if you just tried on your own alittle bit before you give up.

  5. #5
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    becoz im using the CString function so i cannot use the itoa() funtion
    or is there way for mi to check for every words in the sentence??
    Did you try it? CString allows an explicit cast to LPCSTR, just pass itoa or atoi the CString object, the methods and operators within the object will handle the rest.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM