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. Algorithms
  4. How to get the index of a cell in a Table

How to get the index of a cell in a Table

Scheduled Pinned Locked Moved Algorithms
c++databasetutorialquestion
2 Posts 2 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.
  • P Offline
    P Offline
    pix_programmer
    wrote on last edited by
    #1

    Hi! I've to print the index of a selected cell in a Table. The table has eight rows and eight columns. The rows are labled from A to H and the cloumns are labled from 1 to 8. If I click the cell in the first row and first column I've to print A1. Similarly If I click the cell in the first row and Second column I've to print B1 My function has to return the index of each and every cell in the table. How to code that function in C++?

    L 1 Reply Last reply
    0
    • P pix_programmer

      Hi! I've to print the index of a selected cell in a Table. The table has eight rows and eight columns. The rows are labled from A to H and the cloumns are labled from 1 to 8. If I click the cell in the first row and first column I've to print A1. Similarly If I click the cell in the first row and Second column I've to print B1 My function has to return the index of each and every cell in the table. How to code that function in C++?

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

      char rowLetter = 'A' + selectedCell.row;
      int columnNumber = selectedCell.column + 1;
      cout << rowLetter << columNumber << endl;
      // or
      printf("%c%d\n", rowLetter, columNumber);

      One of these days I'm going to think of a really clever signature.

      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