Search
 
SCRIPT & CODE EXAMPLE
 

C

C access global variable same name

// C Program to demonstrate that we can access a global
// variable if we have a local variable with same name
#include <stdio.h>
  
// Global variable x
int x = 50;
  
int main()
{
    // Local variable x
    int x = 10;
    {
        extern int x;
        printf("Value of global x is %d
", x);
    }
    printf("Value of local x is %d
", x);
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: konami code hdl 
C :: how to make C program blink on screen 
C :: arrow keys gaming keyboard 
C :: call cuda kernel from c parameters 
C :: C Program to Maintain an Inventory of items in Online Store 
C :: VLOOKUP CHECK #N/A 
C :: Here is a program in C that illustrates the use of fscanf() to read a text file: 
C :: command line arguments to copy paste in c 
C :: check if string is number c 
C :: link a lib iusing pragma 
C :: Categorize students according to their marks 
C :: gnuplot rectangle border color 
C :: c program for airthmetic operators 
C :: add last in list c 
C :: under 
C :: arr+1 vs &arr+1 
C :: print hello world c 
C :: FivemStore 
C :: time to apply pmfby 
C :: i765 OPT filing fees october 2 
C :: print binary c 
C :: free array in c 
C :: default password raspberry pi 
Dart :: flutter generate random color 
Dart :: flutter datetime to string 
Dart :: flutter trigger show off keyboard 
Dart :: flutter textfield with icon onclick 
Dart :: flutter scroll to bottom 
Dart :: raisedbutton flutter 
Dart :: flutter firestore read data 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =