Re: Split string whose length is varying



Java and Swing <codecraig@xxxxxxxxx> wrote:

> thanks for the input, i will try to make changes as you suggested.
> what simpler ways are there to count the number of commas in msg?

It is proper Usenet etiquette to include the text you are replying to.
To do this using Google groups, please follow the instructions below,
penned by Keith Thompson:

If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

(That said, assuming count is an int and cp is a char *:

count=0;
while( (cp=strchr(msg,',')) != NULL ) {
count++;
cp++;
}

is much better for counting commas.)

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
.



Relevant Pages

  • Re: Flowcharting...in or out?
    ... Another exception required is that a significant bottom or top, ... I figured out how to add this exception. ... and identify the biggest swing top and biggest swing ... The idea of recursion is that once you have done that, ...
    (comp.lang.basic.visual.misc)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... >> pointer to the opaque structure, and ensure the buffer module ... >> data in the hashlib module. ... > If you go far enough in this direction, you'll end up at Java. ... the broken "Reply" link at the bottom of the article. ...
    (sci.crypt)
  • Re: Head position - woods vs. irons
    ... As long as the club doesn't contact the ground (at least prior to ... it would be better to have the same swing ... You and I aren't consistent enough to hit the ball exactly the same ... If we bottom up early, ...
    (rec.sport.golf)
  • Segmented Cookie Dish for Santa
    ... 1/2" finished diameter turned on a lathe with a swing of 10". ... next to the bottom of the bowl. ... I don't even own a bowl scraper. ...
    (rec.crafts.woodturning)
  • "java applet window" in JMenu
    ... "Java Applet Window" at the bottom of JMenu areas and also ...
    (comp.lang.java.gui)