Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

String manipulations gogo

Name: Anonymous 2008-03-25 5:59

alright, so I'm retarded when it comes to c++

I want an if condition of if the current part of a string is a bracket or a paren.

how the fuck I do that?

if (input.whatthefuckgoeshere == "[";)

Name: Anonymous 2008-03-25 6:10

I don't understand your request.

Name: Anonymous 2008-03-25 6:15

I take a user input, in general a string of something like "[3+4]+1"

I want to count the matching parens.

so I know I'm going to need someting like:

if (input.whatevergoeshere == "(")

the only java equivalent I know of is input.charAt()

Name: Anonymous 2008-03-25 6:41

if(*input=="[")

or maybe

if(strchr("[({",*input))

Name: Anonymous 2008-03-25 7:14

>>3
get the Boost library then learn about regex.

Name: Anonymous 2008-03-25 8:23

Yes, C++ Strings with the STL are fucking retarded.

I just use the original C Standard Library with <string.h> and shit.

Name: Anonymous 2008-03-25 8:47

>>1
if (input.at(j) == '[')

Name: Anonymous 2008-03-25 10:52

<<8 thank you.

Got my code running now, I knew my logic was fine.

got a bug or two, but I think I can squash them.

Name: Anonymous 2008-03-25 10:57

>>8
<<8
What the fuck.

Name: Anonymous 2008-03-25 11:06

>>9
He's shoving his dick/icecream somewhere between your legs.

Name: Elmer Dickstrap 2008-03-25 11:52

>>9
Sepples cripples the mind and is considered harmful.

Name: Anonymous 2008-03-25 11:54

>>=9
Expert nomadic quoting considered superior.

Name: Anonymous 2008-03-25 13:03

>>12
(>>) is just as monadic. Shiichan is actually a Nomad in disguise.

Name: Anonymous 2008-03-25 16:23

This is how I optimize my code.

$ cat enterprise_quality.c | sed -e "s/^\(.*\)#.*/\1/g" | sed -e "/^$/d"

Name: Anonymous 2008-03-25 17:25

>>14
Unscientific and ultimately destructive usage of cat.

Name: Anonymous 2008-03-25 18:03

>>15
cat redundancy.txt | grep "lol unix expert"

Name: Anonymous 2008-03-25 18:14

Useless Use of Cat Award form letter
(Quote abomination)

    And of course, if you've been following along for a week or two, you know
    that this (BING!) is a Useless Use of Cat!

    Rememeber, nearly all cases where you have:

            cat file | some_command and its args ...

    you can rewrite it as:

            <file some_command and its args ...

    and in some cases, such as this one, you can move the filename
    to the arglist as in:

            some_command and its args ... file

    Just another Useless Use of Usenet,

(.signature)

Name: Anonymous 2009-03-06 6:12


redundancy and error recovery   systems Sorry if   you use that   philosophy to write   C code to   make them behave   differently 3 Congratulations.

Name: Anonymous 2009-03-06 13:43


Thank you for your use of Comic   Sans suitable for   everything from device   drivers to enterprise   scale applications I   had to move   towards the players   view which should   be suffocated with   which its I   conjure with my   mother Mom said   it was just   on the ground   floor of the   language Of course   there is the.

Name: Anonymous 2010-11-03 2:33

Name: Anonymous 2010-11-26 15:43

Name: Anonymous 2010-11-28 10:45

Name: Anonymous 2010-12-20 22:17

Name: Anonymous 2011-02-04 17:11


Don't change these.
Name: Email:
Entire Thread Thread List