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 have a program in Perl I'm working on where I would need multiple
I am working in the Linux environment, and I have a C++ program, what
I have been working on a childish little program: there are a bunch of
I'm working on a C# program, and right now I have one Form and
I'm working on a java program, and I have several vectors defined and filled
I have a program that spits out both standard error and standard out, and
I have a program that creates a Windows user account using the NetUserAdd() API
I have a program that uses the mt19937 random number generator from boost::random. I
I am trying to write a C++ program that works like the game 24.
I have a project that I am working on that references a Common Library

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.