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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:19:56+00:00 2026-05-13T19:19:56+00:00

This coulde be a dumm question, but i can’t figure it out what i

  • 0

This coulde be a dumm question, but i can’t figure it out what i am doing wrong( i haven’t used two structures in each other ).

I have two structures:

struct test
{
    struct ddata* difference;
    int diff;
};
struct test *MSG; 

struct ddata  
{
    char *filename;
    char *size;
};
struct ddata *difference

And i want to give them values this way (and my program freezes out here):

  MSG->difference = difference;  
  MSG->diff = diff;

So what am i doing wrong?

Thanks in advance!

kampi

EDIT:

The difference struct variable is created in one of my function (and in there i want to give value to my MSG structure). The MSG struct variable is declared globally(i don’t know if this is relevant or not). The difference value is declared and filled up this way:

struct ddata *difference = (struct ddata *) malloc( dif * sizeof *difference );    
memset( difference, 0, dif * sizeof *difference ); 
...
...
...
difference[diff].filename = strdup( primary[i].filename );
difference[diff].size = strdup( primary[i].size );
diff++;

I hope i gave you what you need.

  • 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-13T19:19:56+00:00Added an answer on May 13, 2026 at 7:19 pm

    Maybe you forgot to do something like this:

    MSG = (test* )malloc(sizeof(test));
    

    ?

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

Sidebar

Related Questions

This could well be a real stupid question, but I can't seem to sort
This could be an amazingly dumb question, but .... I don't think a standard
This could be a novice question, but here goes... Why do we use data**.d**
This could be the silliest question I've ever made, but why does the text
This could well be a stupid question, but I'm new to Java, so... I've
This could very well be a basic question - but I was unable to
This could be a question for serverfault as well, but it also includes topics
This could turn out to be the dumbest question ever. I want to track
This could be a silly or stupid question, but how do I enter a
This could be a very basic question for prodigies.But I have a doubt to

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.