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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:10:48+00:00 2026-05-31T20:10:48+00:00

Unlike a lot of the other ‘x’ does not name a type errors on

  • 0

Unlike a lot of the other ‘x’ does not name a type errors on here, I don’t think this one involves circular dependencies, but I’m still having trouble figuring it out.

typedef struct        /* structure definitions */
{
   float  mat[4][4];
}  matrix_unit;

matrix_unit I = {
{ 1., 0., 0., 0.,
  0., 1., 0., 0.,
  0., 0., 1., 0.,
  0., 0., 0., 1  },
};

matrix_unit *stack[50];    /* (line 456) array of pointers to act as a stack */
matrix_unit stackbase = I;
stack[0] = &stackbase;  // 'stack' does not name a type

Since stack has already been declared as a stack of pointers to matrix_unit structs, shouldn’t this be valid?

When I compile the code with “gcc -c 3D.c”, I get the following errors from these lines:

3D.c:457:1: error: initializer element is not constant
3D.c:458:1: warning: data definition has no type or storage class
3D.c:458:1: error: conflicting types for ‘stack’
3D.c:456:14: note: previous declaration of ‘stack’ was here
3D.c:458:1: error: invalid initializer

Thanks in advance for the help.

  • 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-05-31T20:10:49+00:00Added an answer on May 31, 2026 at 8:10 pm

    The compiler is trying to parse line 458 as a declaration. It is not, it is a statement. Statements must be written inside a function. Like this:

    void initialize() 
    {
        stack[0] = &stackbase;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using EPiServer for this website. Unlike asp:DataList , EPiServer:PAgeList does not have AlternatingItemTemplate
Unlike the other posts about the task delete all tables, this question is specifically
Unlike new and delete expressions, std::malloc does not call the constructor when memory for
Unlike in java why c# does not have a supertype of Number for Floats,
I have an app using ListView not unlike Explorer does, but when I set
I have read a lot of related topics here regarding this problem but I
Unlike Windows, GNOME and most other GUI's, OS X application programs do not all
Unlike Java, why does C# treat methods as non-virtual functions by default? Is it
Unlike this question: Linker Error while building application using Boost Asio in Visual Studio
Unlike std::map and std::hash_map, corresponding versions in Qt do not bother to return a

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.