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. Managed C++/CLI
  4. How to get the total length of elements in ##__VA_ARGS__

How to get the total length of elements in ##__VA_ARGS__

Scheduled Pinned Locked Moved Managed C++/CLI
tutorial
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.
  • E Offline
    E Offline
    elelont2
    wrote on last edited by
    #1

    Hi, heading says it all, how could i find out the total length of the string in the ##__VA_ARGS__ Thanks

    J 1 Reply Last reply
    0
    • E elelont2

      Hi, heading says it all, how could i find out the total length of the string in the ##__VA_ARGS__ Thanks

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

      elelont2 wrote:

      heading says it all, how could i find out the total length of the string in the ##__VA_ARGS__

      Subject says "elements". Your statement says "string". For a string you use null termination or the string length property (depending on what you mean by string.) In standard C++ if you want to know a count of arguments passed then you need to provide a mechanism for doing that yourself. Just like if your printf format string doesn't match the args passed then it will go off the end. Thus the format string implicitly defines the count. Not sure but in Managed C++ it might be an actual array so you should be able to get to the Length property.

      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