Einfaches Array C++ Problem

New member
Hallo,

ich habe folgende Ausschnitte im C++-Programm

Code:
[SPOILER]#include <iostream>
#include <ostream>
#include <stdlib.h>
#include <stdio.h>
#include <fstream>
#include <string>
#include <string.h>
#include <sstream>
#include <math.h>
#include <cstdlib>
#include <windows.h>
using namespace std;[/SPOILER]

class VarArray{
      private:
       ...
       long *larray[];     // longarray
       double *darray[]; // doubleArray
      
      public:
       VarArray(int laenge, char* typ){ 
                  ...
                  larray=new long[laenge];
                  ...
                  darray=new double[laenge];
                 ...
       } // end Konstruktor

Es folgen die Fehlermeldungen:
"incompatible types in assignment of `long int*' to `long int*[0u]'"
"incompatible types in assignment of `double*' to `double*[0u]'"

Weiß jemand woran das liegen könnte. Eigtl sollte es nicht all zu kompliziert sein, aber ich beiß mir mittlerweile schon lange genug die Zaehne daran aus :fuchtel:

Danke schon mal im Vorraus :)
 
Sehr komisch. Nun klappt es. Ich hätte schwören können, dass ich das ausprobiert hätte. War ja naheliegend.

Dies wäre wohl auch möglich:
Code:
[COLOR=#000000] void* arr;

   public:
      VarArray(int length, char* type){
         ...
            this->arr = new double[length];
         ...
      }
[/COLOR]
 

Online-Statistiken

Zurzeit aktive Mitglieder
1
Zurzeit aktive Gäste
192
Besucher gesamt
193

Beliebte Forum-Themen

X
Keine passende Antwort gefunden?