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 8864315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:12:43+00:00 2026-06-14T16:12:43+00:00

In main.C I am trying to access a nested structure member (g.Fp1.d_status) and am

  • 0

In main.C I am trying to access a nested structure member
(g.Fp1.d_status) and am getting the error:

‘g.GridPt::Fp1’ does not have class type

Below is my code. I can realy use some help. Thanks.
I tried stuff like g.MarchingDirection::Fp1.d_status,
g.&MarchingDirection::Fp1.d_status, … with no luck.


//Filename: main.C

#include "GridPt.h"

int main()
{   
    GridPt g;

    g.d_lstDistFn;
    g.Fp1.d_status; \\ERROR: 'g.GridPt::Fp1' does not have class type

    return 0;
}

//Filename: MarchingDirection.h

#ifndef included_MarchingDirection
#define included_MarchingDirection

struct MarchingDirection
{
    MarchingDirection(double FValue);   

    double d_F;              
    int d_inOut;             
    char d_status;          
};
#endif

//Filename: MarchingDirection.C

#include "MarchingDirection.h"

MarchingDirection::MarchingDirection(double FValue)  
: d_F(FValue),
  d_inOut(static_cast<int>(FValue)),
  d_status('d'){}

//Filename: Grid2D.h

#ifndef included_GridPt
#define included_GridPt

#include "MarchingDirection.h"
#include <cstddef>

struct GridPt
{   
    GridPt();    

    double d_x, d_y; 
    MarchingDirection Fp1(double F=1.0), Fm1(double F=-1.0);
    double d_lstDistFn;    
};

#endif 

//Filename: GridPt.C

#include "GridPt.h"

GridPt::GridPt() 
: d_lstDistFn(0.0){}
  • 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-14T16:12:44+00:00Added an answer on June 14, 2026 at 4:12 pm

    You declared Fp1, Fm1 functions inside GridPt struct, they are not members

    You could change to:

    struct GridPt
    {   
        GridPt();   
    
        double d_x, d_y; 
        MarchingDirection Fp1, Fm1;
        double d_lstDistFn;    
    };
    

    Initialize all your struct members shown as below:

    GridPt::GridPt() 
    : d_x(0.0), 
      d_y(0.0), 
      Fp1(1.0),
      Fm1(-1.0),
      d_lstDistFn(0.0)
    {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List in the main application and I am trying to access
Whenever I'm trying to access a rubygem, i'm getting an error. E.g. with rails
I am trying to create a few nested classes within my main class. public
I’m trying to access a module’s data from inside its __main__.py . The structure
After trying to access ivars using KVC, I have noticed that there was no
How do I access a static member in a class with all static methods?
I am trying to access a function from a class from within a class
Hello I am trying to access a private member function is Gtest . The
I got this error when trying to access 'model' and 'CRUD' generator in gii.
Hi I have been trying to access the validation rules of an associated model

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.