Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:45:23+00:00 2026-06-14T00:45:23+00:00

I have this class and struct, and every struct on the array connected to

  • 0

I have this class and struct, and every struct on the array connected to another struct (linked list structure on every element of array)..
btw this is just a sample of my code, assume there are no other errors..

class DATA;
class myclass
{
     public:
         myclass();

         mystruct* addDATA(DATA *d);

     private:
         mystruct* array;
};
struct mystruct
{
    DATA     * data;
    mystruct * next ;

};

In the constructor I am trying this

 mystruct::mystruct()
 {
     mystruct* array = new mystruct[10];
     for(int i = 0; i < 10; i++)
         array[i] = NULL; 
 }

this gives an unexpected(at least to me) error, Isn’t this error a bit ridiculous, I am making pointers to point to NULL.

no match for ‘operator=’ in ‘*(array + ((unsigned int)(((unsigned int)i) * 8u))) = 0’

And also when I try to;

while(this->array[i] != NULL){
    // do some arrangements on the array..

}

This also gives the same error.. Why would matching a pointer to NULL give this error, or checking if its NULL or not..Struggling since this morning, couldn’t find a **ing solution :/
Array’s type is “mystruct” but nothing else, Is this a problem? Or array[i] is not a pointer or something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:45:24+00:00Added an answer on June 14, 2026 at 12:45 am

    No you are not making an array of pointers, you’re a making an array of structures. Each element of array is a mystruct not a mystruct*. It doesn’t make any sense to set a mystruct to null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: struct A{}; template<class T = A> struct B { void
I have this class file call SMSHelper.cs First I just wanted to know is
I have this class: class OriginalClass { string FirstItem; List<string> ListOfSecondItems; } I want
Say I have this basic setup: #include <list> struct Linker { Linker* to; //some
I have this class: Class B { private String D; private String E; }
I have this class in which I run a for loop 10 times. This
I have this class which i would like to map: public class Contract {
i have this class public class Image { public string url { get; set;
i have this class called MemoryManager, it is supposed to implement a simple smart
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.