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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:30:55+00:00 2026-05-25T10:30:55+00:00

I have a program I am working on that is basically like this: bool

  • 0

I have a program I am working on that is basically like this:

 bool isUnique(char**,int,char[]);

 int main() {
    char** uniqueWords = new char *[MAXWORDSIZE];
    uniqueWords[posofUnique] = new char[MAXWORDSIZE];
    //assign value to uniqueWords[0]="value"
    isUnique(uniqueWords,posofUnique,currentWord);
 }

 bool  isUnique(char **uniqueArray, int amountofArrayFilled, char currentWord[]){
    for (int count =0; count < amountArrayFilled; count++){
        bool isEqual = strcmp(uniqueArray[count],currentWord);
    }
    return false;
}

however uniqueArray only loads in one character on strcmp. How do I get it to load the entire array?

  • 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-25T10:30:56+00:00Added an answer on May 25, 2026 at 10:30 am

    Your uniqueWords array has MAXWORDSIZE elements and all of them contain garbage pointer values immediately after allocation.

    Then you set uniqueWords[posofUnique] pointer to some newly allocated memory. So, that single entry now holds some more-or-less meaningful value. The other entries of uniqueWords array still contain garbage values.

    Then you call isUnique, which attempts to inspect array entries from uniqueWords[0] to uniqueWords[posofUnique - 1]. But these entries still contain meaningless garbage values!

    So, whatever you see through these non-initialized entries means absolutely noting. It is just some unpredictable garbage at some random address in memory. You say you see “only one character” there? Congratulations. With the same degree of success you can discover the lost proof of Fermat’s Great Theorem there.

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

Sidebar

Related Questions

I'm having troubles getting this to work. Basically I have a python program that
I have a program that I'm working on that register global hotkeys I would
I have a working program in C++ that generates data for a Mandelbrot Set.
I have a simple Delphi program that I'm working on, in which I am
I have this program that I want other processes to be able to call
I'm working on a Windows game, and I have this: bool game_cont; LRESULT WINAPI
I'm working on a program that feeds a number (int) to a 2D array.
I have a program in Perl I'm working on where I would need multiple
I have a requirement for a program I'm working on to store job numbers
I am working in the Linux environment, and I have a C++ program, what

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.