Thread: Very easy issue with strstr

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Code:
      while(c = strstr(&s[i], from)) {  //i is the iterator for s 
        while(&s[i]!= c)                //j is the iterator for s1
        s1[j++]=s[i++];
    Your indentation could use a little work Adak.

    Quzah.
    Hope is the first step on the road to disappointment.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    That was my test to see if ya'll were paying attention.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Adak View Post
    That was my test to see if ya'll were paying attention.
    LOL... Don't ya just hate it when that happens?

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Naw, like the song says:

    "Life will never be, exactly like you want it to be..."
    ... Mamas and the Papas

    Just had a great laugh, as reported on the BBC. UK squad under fire in Afghanistan, see's the 3 gunmen on a rooftop, and starts returning fire. Two of the gunmen take off, the last one grabs a young girl for a shield, and keeps on firing. The Brits don't shoot back, fearing to hit the girl, then one Brit solder yells out:

    "I've been shot in the head, but I'm fine!"

    The gunman's bullet hit, but did not get through, his helmet.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with strstr func...embedded system
    By kievari in forum C Programming
    Replies: 2
    Last Post: 03-27-2010, 03:43 AM
  2. Some weird issue.
    By dbzx in forum C Programming
    Replies: 7
    Last Post: 04-12-2009, 04:10 PM
  3. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 04:56 AM
  4. re-entrancy pattern issue setbacks
    By George2 in forum Windows Programming
    Replies: 0
    Last Post: 04-12-2008, 02:23 AM
  5. How can I issue AT commands in VC++ ?
    By Cube in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-10-2001, 07:45 AM