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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:38:40+00:00 2026-05-14T18:38:40+00:00

I have a weird problem in C. I have a structure and I pointed

  • 0

I have a weird problem in C. I have a structure and I pointed sample to that structure :

test sample;

now in the code, I call that structure through a function :

function is called something, so something(&sample) is used to point the structure in the function.

Now I need to copy values of sample to sample2 .. So I want sample2 to point to the same structure as well. So I also declared test sample2 before main, and used it as a global variable. Now when its used to point to contents in the structure in the function, sample must be called without a (*sample2).content or sample2->content. I only need to write sample2.content. I understand that this happens because sample2 declared globally… But I also get this when compiling :

comment 528 - Argument 'sample2' conceals a global declaration of the same symbol

The program runs fine, but I want to get rid of this compiler message… Why does it say that ? what does it mean ?

  • 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-14T18:38:41+00:00Added an answer on May 14, 2026 at 6:38 pm

    The issue is that inside the function if you refer to the symbol sample the compiler has two things to choose from. The first is the global variable and the second is the argument you provided to the function. What the compiler is doing is alerting you to the fact that it assumes you mean the local variable and not the global one.

    In general this is a recipe for grief and bugs, and you say that your code runs as intended. I cannot say how or why without looking at it in detail. The simplest answer is to just change the name of the argument to your function to something different or the global variable to something different.

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

Sidebar

Related Questions

i have a weird problem, i have a wcf hosted in a Console Application
I have a weird problem with a ListBox in Wpf, where I have a
I have a weird problem (at least in my opinion). When I add a
I have a weird problem with my i18n doctrine schema and i.a. the admin
I have a weird problem using the Java Box class. I am using JDK
i have a weird problem ! i have ASP.NET website and i have a
So - I have this weird problem. I have a major project, no details
Okay, I have this weird problem in Firefox. I type in Firebug's console $
I am trying to search for any string that contains ; in a column
I created a function to take location input, pass it to Google Maps Javascript

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.