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. Question about switch statement

Question about switch statement

Scheduled Pinned Locked Moved C#
question
4 Posts 3 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.
  • A Offline
    A Offline
    Andrei Ungureanu
    wrote on last edited by
    #1

    Hy, Can you put in a switch statement anything else besides basic types...i mean can you do something like:

    DataColumn dt;

    switch(dt)
    {
    case ...:
    case ...:
    }

    Thanks.

    There are 10 kinds of people: those who understand binary and those who don't

    J J 2 Replies Last reply
    0
    • A Andrei Ungureanu

      Hy, Can you put in a switch statement anything else besides basic types...i mean can you do something like:

      DataColumn dt;

      switch(dt)
      {
      case ...:
      case ...:
      }

      Thanks.

      There are 10 kinds of people: those who understand binary and those who don't

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      No, integral types only (string,int,short,decimal etc)

      --- How to get answers to your questions[^]

      A 1 Reply Last reply
      0
      • J J4amieC

        No, integral types only (string,int,short,decimal etc)

        --- How to get answers to your questions[^]

        A Offline
        A Offline
        Andrei Ungureanu
        wrote on last edited by
        #3

        Thanks. Back to the drawing board :->

        There are 10 kinds of people: those who understand binary and those who don't

        1 Reply Last reply
        0
        • A Andrei Ungureanu

          Hy, Can you put in a switch statement anything else besides basic types...i mean can you do something like:

          DataColumn dt;

          switch(dt)
          {
          case ...:
          case ...:
          }

          Thanks.

          There are 10 kinds of people: those who understand binary and those who don't

          J Offline
          J Offline
          JSSUML
          wrote on last edited by
          #4

          You can as long as the type you are using can be evaluated to a numerical value.

          ================================ Wirth's law: Software gets slower faster than hardware gets faster.

          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