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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:17:06+00:00 2026-05-22T12:17:06+00:00

I am trying to add multiple character arrays to a function: #define ID_LEN 5

  • 0

I am trying to add multiple character arrays to a function:

#define ID_LEN 5
#define MAX_NAME_LEN 25
#define FALSE 0
char **orderedIds, buffer[5], idString[ID_LEN + 1], inputName[MAX_NAME_LEN + 1], inputDrinkType;
char inputDescription[240];
int i, listSize = 0, uniqueID, validated = FALSE;

This will run fine. However if I add one more byte to inputDescription it will give me an abort trap error:

char inputDescription[241];

Also if I add new string arrays I get the same error:

char inputDescription[240], newStringArray[10];

It is a big project with multiple files and functions, adding all the code to give the bigger picture might be a bit hard…. Does anybody know what is happening here???

Resolved:
It all boiled down to me not null terminating a string I was building, before using it in strcat.

  • 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-22T12:17:07+00:00Added an answer on May 22, 2026 at 12:17 pm

    Yes, but only in general

    C is not a memory safe language. It’s possible to alias an object with an other accidentally; this is sometimes called a wild pointer or a dangling pointer.

    The problem isn’t really with whether inputDescription has 240 or 241 bytes, rather, the problem is in which object is aliasing which other one and whether that causes a fatal error or a smaller problem. Small changes to your program change the memory layout and change the symptoms of the failure, but the cause is a bug in the program’s source code.

    If you clean up the program you will probably find the problem.

    1. Have a prototype for everything
    2. Turn on some or all of the compiler warnings and fix the identified problems
    3. Incorporate a memory debugger
    4. Use a general-purpose debugger and get a traceback
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add multiple instances of UIImageView(s) to an NSMutableArray of NSMutableDictionar(ies). I
I'm trying to add multiple jQuery data entries to a single element. I suspected
I'm fairly new to JQuery and I'm trying to add multiple form fields for
Ok, I am trying to add one row of multiple images to a JPanel,
I am trying to add or connect multiple sql queries dynamically. I am creating
I am trying to add multiple inline form items to a page using Djangos
I am trying to add some multiple form fields in separate divs. But by
I've been searching all over trying to find simple code to add multiple markers
I am trying to add multiple spaces in my var but it get's cut
I am trying to add multiple texts on canvas element of HTML5 using context.fillText(...)

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.