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 be a dumb question, but men, I'm newbie on iPhone-sdk. I walk
This could sound like a very simple question to many of you, but I
This could be a borderline advertisement, not to mention subjective, but the question is
This could be a very basic question for prodigies.But I have a doubt to
I know this could be a subjective question, but I want to know your
Hi guys i believe this could turn out to be trivial but i have
Explain how this could print out two different values: <%@ Control Language=C# Inherits=System.Web.Mvc.ViewUserControl<IList<Models.AModel>> %>
This could be a very basic question, but hopefully someone will be able to
This could be a dumb question, but I have submitted a few apps where
I'm trying to figure out if this could somehow be overflowed: void print_address(char *p)

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.