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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:22:24+00:00 2026-06-01T06:22:24+00:00

Sorry this is a basic question, but all my research just barely missed answering

  • 0

Sorry this is a basic question, but all my research just barely missed answering my question and I just wanted to double check before I write all my code with an assumption.
I’m using C and I have a header file with some variables declared (ints, char arrays, int arrays). If I have a function that makes use of these global variables I am assuming that I can use the variables without passing them?

EXAMPLE
HEADER FILE:

int state;
int lnArray[];

C FILE:

void function(){ 
    int i;
    for(i=0;i<5;i++;){
        if(lnArray[i]<10)    
        state = lnArray[i];
    }
}
  • 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-01T06:22:26+00:00Added an answer on June 1, 2026 at 6:22 am

    That’s correct. It’s why they’re called “global” variables: they’re available in any scope.

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

Sidebar

Related Questions

G'day All, I am working in R. Sorry about this really basic question, but
Sorry for this basic question, but I've been looking over all the info about
Sorry if this is a really basic question but it's been really getting to
Sorry, this might be a basic/stupid/noob question - I am just trying to tweak
Sorry for asking a basic question like this but I've been reading on this
Sorry for asking this question, but I searched all Java-related questions, but I got
Sorry for the very basic question, but this is actually a 2-part question: Given
Very sorry for the basic question but I've seen this implemented in so many
Sorry, another super basic ASP.NET question. this so embarrassing. I am reading the article
Ok sorry this might seem like a dumb question but I cannot figure this

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.