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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:14:23+00:00 2026-06-17T10:14:23+00:00

I have a structure and want to increase an array size whenever SendMessage function

  • 0

I have a structure and want to increase an array size whenever SendMessage function calls

struct MQStruct {
    wchar_t *serviceName; 
    int durability; 
    int msgType; 
    int msgHeader; 
    wchar_t *msgId; 
    wchar_t *payload; 
    int payloadSize; 
    int ttl; 
    int priority;
}MQStructObj[1];


int SendMessage(wchar_t *serviceName, int durability, int msgType, int msgHeader, wchar_t *msgId, wchar_t *payload, int payloadSize, int ttl, int priority) {

//Want to add one more array object and also preserve data of previous
MQStructObj[MAX+1]

return 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-17T10:14:25+00:00Added an answer on June 17, 2026 at 10:14 am

    In C you will have to deal with dynamic memory (i.e allocate the array using malloc(), then take care to call free() when you stop using it etc.) yourself, and possibly use realloc() to grow an allocation.

    In C++ the problem is already solved for you and you have std::vector. You may call push_back to add elements dynamically to it.

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

Sidebar

Related Questions

I have structure, public struct Test { public int int1; public string str; }
i have following structure: <td> <input name=foo size=45/> </td> And i want to dynamically
I have this structure which I want to write to a file: typedef struct
I have the following structure: struct CountCarrier { int *CurrCount; }; And this is
I have a structure: typedef struct { double x,y,z; } XYZ; I want to
I have a table Sample and another SampleLog With these structure I want to
i have table structure with 3 colums (column1, column2, column3) and i want to
I have list of structure. I want to modify a particular data from the
I have a directory structure of directories and files that I want to render
I have this file structure: folderIWantStuffIn/ - old_stuff Now I want to add some

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.