Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Question of the day....

Question of the day....

Scheduled Pinned Locked Moved The Lounge
csharpquestionc++css
22 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Michael Dunn

    d) Makes you do it the VB.NET way, or else As long as they keep making me laugh, I'm all for it. VB or no VB. ;) --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork-100.19012 Acid_Helm

    N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #7

    Michael Dunn wrote: As long as they keep making me laugh, I'm all for it. Heheh. It didn't make me laugh though. Twas funny anyway. "OrElse" he said :-) heheheheh :-D


    Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

    1 Reply Last reply
    0
    • C Christian Graus

      Chris Maunder wrote: We've got VB.NET, C#, ASP, javascript, plain vanilla C and even an article on Forth True, there are nine articles on VB.NET. There are more than that on OpenGL ( being the most off topic thing I could see on the list ), so are we going to see some OpenGL questions ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #8

      Christian Graus wrote: so are we going to see some OpenGL questions ? Man!!! You Aussies sure know how to be sarcastic! :-)


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

      C 1 Reply Last reply
      0
      • N Nish Nishant

        Christian Graus wrote: so are we going to see some OpenGL questions ? Man!!! You Aussies sure know how to be sarcastic! :-)


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #9

        Nish - Native CPian wrote: Man!!! You Aussies sure know how to be sarcastic! Did Chris say something sarcastic ? :P Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

        N 1 Reply Last reply
        0
        • C Christian Graus

          Nish - Native CPian wrote: Man!!! You Aussies sure know how to be sarcastic! Did Chris say something sarcastic ? :P Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #10

          Christian Graus wrote: Did Chris say something sarcastic ? Ouch!!! A sub-joke! Wise guy!!! :-D


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

          1 Reply Last reply
          0
          • C Christian Graus

            Chris Maunder wrote: We've got VB.NET, C#, ASP, javascript, plain vanilla C and even an article on Forth True, there are nine articles on VB.NET. There are more than that on OpenGL ( being the most off topic thing I could see on the list ), so are we going to see some OpenGL questions ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #11

            So send me some STL questions then. cheers, Chris Maunder

            M C 2 Replies Last reply
            0
            • C Christian Graus

              Why am I being asked about VB.NET operators on a C++ programming website ? I wouldn't mind if it was C#, but surely only a very small number of us are afflicted with VB, and VB.NET even less so ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

              D Offline
              D Offline
              David Wengier
              wrote on last edited by
              #12

              I never knew there was this feeling towards VB.NET. I knew there was dislike, and refusal to use it etc. but your post sounds like downright hatred. Why does it worry you that there exists such a language? -- David Wengier Sonork ID: 100.14177 - Ch00k

              C 1 Reply Last reply
              0
              • D David Wengier

                I never knew there was this feeling towards VB.NET. I knew there was dislike, and refusal to use it etc. but your post sounds like downright hatred. Why does it worry you that there exists such a language? -- David Wengier Sonork ID: 100.14177 - Ch00k

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #13

                David Wengier wrote: Why does it worry you that there exists such a language? I don't care that it exists at all. I'd just prefer not to be reminded of it :-) Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                C 1 Reply Last reply
                0
                • M Michael Dunn

                  Chris Maunder wrote: So send me some STL questions then. Q: How would you write a strtok() equivalent using the string methods? Mail your responses to Mike Dunn (preferably by tomorrow, not that he has a deadline then or anything). --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #14

                  Using ONLY the methods in std::string, or also using the algorithms provided by the STL ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                  M 1 Reply Last reply
                  0
                  • C Chris Maunder

                    So send me some STL questions then. cheers, Chris Maunder

                    M Offline
                    M Offline
                    Michael Dunn
                    wrote on last edited by
                    #15

                    Chris Maunder wrote: So send me some STL questions then. Q: How would you write a strtok() equivalent using the string methods? Mail your responses to Mike Dunn (preferably by tomorrow, not that he has a deadline then or anything). --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                    C T 2 Replies Last reply
                    0
                    • C Chris Maunder

                      So send me some STL questions then. cheers, Chris Maunder

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #16

                      Chris Maunder wrote: So send me some STL questions then. Am I REALLY that belligerent about STL ? :P I will send you something probably tonight. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                      1 Reply Last reply
                      0
                      • C Chris Maunder

                        You do realise that the whole .NET thing is merely a ploy to get people to move from C++ to C#, onto VB.NET and then to the one true language: VBScript. You will be assimilated. cheers, Chris Maunder

                        C Offline
                        C Offline
                        Christian Graus
                        wrote on last edited by
                        #17

                        Well, I use C++ and VBScript already, so can I skip the VB.NET part ? :-) Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                        1 Reply Last reply
                        0
                        • C Christian Graus

                          Using ONLY the methods in std::string, or also using the algorithms provided by the STL ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                          M Offline
                          M Offline
                          Michael Dunn
                          wrote on last edited by
                          #18

                          Algorithms are acceptable too :) --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                          1 Reply Last reply
                          0
                          • C Christian Graus

                            David Wengier wrote: Why does it worry you that there exists such a language? I don't care that it exists at all. I'd just prefer not to be reminded of it :-) Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                            C Offline
                            C Offline
                            Chris Maunder
                            wrote on last edited by
                            #19

                            You do realise that the whole .NET thing is merely a ploy to get people to move from C++ to C#, onto VB.NET and then to the one true language: VBScript. You will be assimilated. cheers, Chris Maunder

                            C 1 Reply Last reply
                            0
                            • C Christian Graus

                              Chris Maunder wrote: We've got VB.NET, C#, ASP, javascript, plain vanilla C and even an article on Forth True, there are nine articles on VB.NET. There are more than that on OpenGL ( being the most off topic thing I could see on the list ), so are we going to see some OpenGL questions ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                              K Offline
                              K Offline
                              KaRl
                              wrote on last edited by
                              #20

                              I'm working with OpenGL for now, and I may have a few questions. May I ? :rolleyes: We're talking shit, 'cause life is a 'biz You know it is Everybody tryin' to get rich God damn! All I wanna do is live ! KoRn, Children of the Korn

                              1 Reply Last reply
                              0
                              • M Michael Dunn

                                Chris Maunder wrote: So send me some STL questions then. Q: How would you write a strtok() equivalent using the string methods? Mail your responses to Mike Dunn (preferably by tomorrow, not that he has a deadline then or anything). --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                                T Offline
                                T Offline
                                Thomas Freudenberg
                                wrote on last edited by
                                #21

                                Following code I am using. It's a modificated version of http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/stringtok_std_h.txt [Paul]

                                template <typename outit>
                                void tokenize (outit x, const std::tstring &in, const TCHAR * delimiters = _T(" \t\n"))
                                {
                                const std::tstring::size_type len = in.length();
                                std::tstring::size_type i = 0;

                                while ( i < len )
                                {
                                	// eat leading whitespace
                                	i = in.find\_first\_not\_of (delimiters, i);
                                	if (i == std::tstring::npos)
                                		return;   // nothing left but white space
                                
                                	// find the end of the token
                                	std::tstring::size\_type j = in.find\_first\_of (delimiters, i);
                                
                                	// push token
                                	if (j == std::tstring::npos) {
                                		\*x = in.substr(i);
                                		++x;
                                		return;
                                	} else {
                                		\*x = in.substr(i, j-i);
                                		++x;
                                	}
                                
                                	// set up for next loop
                                	i = j + 1;
                                }
                                

                                }

                                Example:

                                std::liststd::string ls;
                                utl::tokenize (std::back_inserter(ls), " this \t is\t\n a test ");
                                for (std::list::const_iterator it = ls.begin(); it != ls.end(); ++it)
                                {
                                std::cerr << ':' << (*it) << ":\n";
                                }

                                would produce following output:

                                :this:
                                :is:
                                :a:
                                :test:

                                Regards Thomas Sonork id: 100.10453 Thömmi


                                Disclaimer:
                                Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.

                                1 Reply Last reply
                                0
                                • C Christian Graus

                                  Why am I being asked about VB.NET operators on a C++ programming website ? I wouldn't mind if it was C#, but surely only a very small number of us are afflicted with VB, and VB.NET even less so ? Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002

                                  J Offline
                                  J Offline
                                  jkgh
                                  wrote on last edited by
                                  #22

                                  Do you fancy coming up with a few lint-type questions? [what do you do if you have an inny type button] Alice thought that running very fast for a long time would get you to somewhere else. " A very slow kind of country!" said the queen. "Now, here , you see, it takes all the running you can do, to keep in the same place".

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups