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. General Programming
  3. C#
  4. unable to spot the error

unable to spot the error

Scheduled Pinned Locked Moved C#
helpcsharplinq
10 Posts 5 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.
  • L Offline
    L Offline
    lawrenceinba
    wrote on last edited by
    #1

    if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

    the quieter u become more u hear

    L R 5 Replies Last reply
    0
    • L lawrenceinba

      if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

      the quieter u become more u hear

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What sort of error? Compiler error? Not the data you excepted?

      L 1 Reply Last reply
      0
      • L Lost User

        What sort of error? Compiler error? Not the data you excepted?

        L Offline
        L Offline
        lawrenceinba
        wrote on last edited by
        #3

        hmmm.. compiler error

        the quieter u become more u hear

        L 1 Reply Last reply
        0
        • L lawrenceinba

          hmmm.. compiler error

          the quieter u become more u hear

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Okay, looks like you actually don't want help.

          N 1 Reply Last reply
          0
          • L lawrenceinba

            if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

            the quieter u become more u hear

            R Offline
            R Offline
            realJSOP
            wrote on last edited by
            #5

            It's probably because all your code is in bold and not formatted correctly for review.

            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            1 Reply Last reply
            0
            • L lawrenceinba

              if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

              the quieter u become more u hear

              R Offline
              R Offline
              realJSOP
              wrote on last edited by
              #6

              If you can't see the problem, you really need to drop the C# class your taking right now. Intellisense lights that code up like a freakin' Christmas tree.

              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

              1 Reply Last reply
              0
              • L lawrenceinba

                if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

                the quieter u become more u hear

                R Offline
                R Offline
                realJSOP
                wrote on last edited by
                #7

                BTW, this is the most frakked up homework assignment on the planet. Does your instructor really want you to use a character array to hold the extracted word? I rewrote your code so that it would work, but I don't know if I want to give it to you because it has the very real possibility of helping you pass the course, and I don't think we need another clueless programmer running around writing crappy code.

                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                C 1 Reply Last reply
                0
                • R realJSOP

                  BTW, this is the most frakked up homework assignment on the planet. Does your instructor really want you to use a character array to hold the extracted word? I rewrote your code so that it would work, but I don't know if I want to give it to you because it has the very real possibility of helping you pass the course, and I don't think we need another clueless programmer running around writing crappy code.

                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  C Offline
                  C Offline
                  CARPETBURNER
                  wrote on last edited by
                  #8

                  Please nooo not another clueless programmer! there are enough in the world at the moment, can we put them all in one place and just push the barge away so they float away out of harms way.. preferablly with no internet connection

                  1 Reply Last reply
                  0
                  • L Lost User

                    Okay, looks like you actually don't want help.

                    N Offline
                    N Offline
                    NikoTanghe
                    wrote on last edited by
                    #9

                    his footer says " the quieter u become more u hear " he's absolutely right: don't give all the info too soon

                    << Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>

                    1 Reply Last reply
                    0
                    • L lawrenceinba

                      if possible antbody help me... do no wat error it contains using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { public static void Main() { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; while (arr[0] != null) { tokenindex = 0; while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';') && (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0') && (arr[0] != '&') && (arr[0] != '-')) strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } }

                      the quieter u become more u hear

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Well in amongst all the flames and elitist comments. I'll assume your a complete n00b and help you out a bit. but I gotta be honest, it was glaringly obvious. using System; using System.Collections.Generic; using System.Linq; using System.Text; class MainClass { int tokenindex = 0; int cntTokens = 0; int iSymbol = -1; int prevDictSymbol = -1; char[] strToken = new char[512]; int i=0; string[] arr = { "Hello", "World" }; public static void Main() { while ((arr[0] != null)&(arr[0]!= ' ')&&(arr[0] != ',')&(arr[0] != ';')&&(arr[0] != '/')&&(arr[0] != '#')&&(arr[0] != '\0')&&(arr[0] != '&')&&(arr[0] != '-')) { tokenindex = 0; strToken[tokenindex++] = arr[0]; arr++; strToken[tokenindex] = '\0'; } Console.WriteLine(" The Token is:", strToken); Console.WriteLine("The Length of strToken", strToken); } } aaarghhh! too many ands. That's as much am I'm going to do, the rest is up to you.

                      modified on Monday, January 26, 2009 2:51 PM

                      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