Question About Strings

This is a discussion on Question About Strings within the C++ Programming forums, part of the General Programming Boards category; Hello What if i have a string ,and want to search for data in it,not from that start,but from a ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    8

    Question About Strings

    Hello

    What if i have a string ,and want to search for data in it,not from that start,but from a specified location how can i do it?


    i tried to using :

    Code:
    string temp ;
    size_t loc;
    temp.find("x",loc);
    But its not working :\

    thanks alot

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    In your code you haven't initialized temp and loc. Otherwise it should work.

    Post a real example that you tried and didn't work and describe how it didn't work (compiler error, unexpected results etc).
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about strings in c
    By gp364481 in forum C Programming
    Replies: 9
    Last Post: 11-13-2008, 05:32 PM
  2. strings question
    By cstudent in forum C Programming
    Replies: 4
    Last Post: 04-18-2008, 07:28 AM
  3. Functions and Strings Question
    By StrikeMech in forum C Programming
    Replies: 4
    Last Post: 07-18-2007, 06:07 AM
  4. Strings question
    By kimimaro in forum C Programming
    Replies: 10
    Last Post: 03-14-2005, 11:14 PM
  5. question about arrays of strings
    By lakai02 in forum C Programming
    Replies: 14
    Last Post: 12-25-2002, 08:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21