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

  • Home
  • SEARCH
  • 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 3354490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:16:46+00:00 2026-05-18T02:16:46+00:00

this is my .h file: struct _MyString; typedef struct _MyString MyString; i would like

  • 0

this is my .h file:

struct _MyString;  
typedef struct _MyString MyString;

i would like to declare its members in the .c file.

i tried:

typedef struct MyString{
    char * _str;// pointer to the matrix
    unsigned long _strLength;
    }MyString;

but it doesn’t work.
how do i declare the struct’s memebers in the .c file?

thank you

  • 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-18T02:16:46+00:00Added an answer on May 18, 2026 at 2:16 am

    You need only 1 typedef. Keep the one you already have in the .h file and delete all others.

    Now, the struct name is struct _MyString. That is what you should define in the .c file, not struct MyString: notice the absence of the ‘_’.

    So

    .h file

    struct _MyString;  
    typedef struct _MyString MyString;
    

    .c file

    #include "file.h"
    struct _MyString {
        char * _str;// pointer to the matrix
        unsigned long _strLength;
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What does this mean exactly? I'm doing something like this: File.Copy(@\\foo\bar\baz.txt, @c:\test\baz.txt); MSDN doesn't
I'd like to build something like this: File 1: template<typename Vector> namespace myNamespace {
my project includes a simple C file with a header. Like this: #ifndef __IMAGE_ARRAY_3D
Hey. I have this in a header file: struct something { int a; int
Can you explain this error for me? In my A.h file: struct TreeNode; struct
How can I create this file in a directory in windows 2003 SP2: .hgignore
I have some code that effectively does this : File file = new File(C:\\Program
I have a generated txt file. This file has certain lines that are superfluous,
I've got a big file on which I'm opening a FileInputStream. This file contains
After saved upload file, i got local url of this file, how i convert

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.