Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. Index/Zahl an Variable anhängen
Forum Updated to NodeBB v4.3 + New Features

Index/Zahl an Variable anhängen

Scheduled Pinned Locked Moved Unsolved German
3 Posts 2 Posters 1.3k 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.
  • gijaG Offline
    gijaG Offline
    gija
    wrote on last edited by
    #1

    Hallo zusammen, :)

    ich suche nach einer Möglichkeit, neue Variablen mit aufsteigendem Index zu deklarieren.
    Zum besseren Verständnis hier mal der Pseudocode:

    for(int i=0; i<3; i++) {
    
          int s + i = 0; 
         
         // das "+" dient nur zum besseren Verständnis
         //es sollen nun folgende Variablen deklariert werden: s0,s1,s2
    }
    

    Ich habe noch andere Lösung im Kopf, jedoch finde ich diese als "einfachste" Variante, falls es denn überhaupt so funktionieren kann.

    Ich hoffe ich konnte euch mein Problem gut schildern.
    Danke für eure Mühe :)

    Grüße

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hallo! Das geht so nicht in C++. Was du nehmen könntest wäre zum Beispiel ein Array oder einfacher ein QVector<int>.

      gijaG 1 Reply Last reply
      0
      • ? A Former User

        Hallo! Das geht so nicht in C++. Was du nehmen könntest wäre zum Beispiel ein Array oder einfacher ein QVector<int>.

        gijaG Offline
        gijaG Offline
        gija
        wrote on last edited by
        #3

        @Wieland Ok vielen Dank für deine Antwort :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved