---
title: "#global-variables articles | Hashnode"
description: "Explore 8 articles tagged #global-variables on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/global-variables"
---

Tag

# #global-variables

8 posts · 0 followers

[Erioifpud](https://hashnode.com/@Erioifpud) · [Aug 3, 2024](https://hashnode.com/posts/rust-1/66ade78aaeb65fcb4f1426b6)

### [Rust 中的全局状态](https://erio.hashnode.dev/rust-1?utm_source=hashnode&utm_medium=feed)

最近写 Rust 程序需要用到全局状态，我希望有一个状态在公共的作用域里，其他模块能通过引入等方式去访问他，在 JS 中做起来很简单： const globalState = { name: 'abc' } function foo() { console.log(globalState) } function bar() { globalState.name = '123' } 由于 JS 的限制较少，变量声明的位置没有限制，在代码顶部声明后，后续所有作用域都能使用。 在...

1 min read · [erio.hashnode.dev](https://erio.hashnode.dev/rust-1?utm_source=hashnode&utm_medium=feed)

[Bear Evans](https://hashnode.com/@bear-evans) · [Apr 14, 2024](https://hashnode.com/posts/global-variables-in-unity-with-scriptable-objects/661b5744c2665f950fa3a664)

### [Global Variables in Unity with Scriptable Objects](https://blog.thebear.dev/global-variables-in-unity-with-scriptable-objects?utm_source=hashnode&utm_medium=feed)

Global variables, the right way.

7 min read · [blog.thebear.dev](https://blog.thebear.dev/global-variables-in-unity-with-scriptable-objects?utm_source=hashnode&utm_medium=feed)

[Jyotiprakash Mishra](https://hashnode.com/@jpmishra) · [Dec 30, 2023](https://hashnode.com/posts/need-globals-without-name-collisions-static-at-file-level/6590518444d2a261846aa7fe)

### [Need globals without name collisions? Static at file level!](https://blog.jyotiprakash.org/need-globals-without-name-collisions-static-at-file-level?utm_source=hashnode&utm_medium=feed)

In C programming, the static keyword can be used in different contexts. When static is used at the file level, also known as file scope or global scope, it gives the variable or function "internal linkage." This means that the variable or function is...

2 min read · [blog.jyotiprakash.org](https://blog.jyotiprakash.org/need-globals-without-name-collisions-static-at-file-level?utm_source=hashnode&utm_medium=feed)

[Jyotiprakash Mishra](https://hashnode.com/@jpmishra) · [Dec 30, 2023](https://hashnode.com/posts/global-variables-are-one-of-a-kind/658fae70f7a71d95d69ff897)

### [Global variables are one of a kind!](https://blog.jyotiprakash.org/global-variables-are-one-of-a-kind?utm_source=hashnode&utm_medium=feed)

Global variables in programming are variables that are defined outside of any function and can be accessed from any part of the code within the same file or, in some cases, from other files as well. Unlike local variables that are created and destroy...

4 min read · [blog.jyotiprakash.org](https://blog.jyotiprakash.org/global-variables-are-one-of-a-kind?utm_source=hashnode&utm_medium=feed)

[Jyotiprakash Mishra](https://hashnode.com/@jpmishra) · [Dec 30, 2023](https://hashnode.com/posts/let-only-one-global-live-the-extern-keyword/658faf0e748d4579d2cec131)

### [Let only one global live! The extern keyword](https://blog.jyotiprakash.org/let-only-one-global-live-the-extern-keyword?utm_source=hashnode&utm_medium=feed)

To demonstrate the use of the extern keyword with global variables in C, I'll create a simple example involving two source files. The extern keyword is used to declare a global variable in one file, which is defined in another. This approach allows m...

2 min read · [blog.jyotiprakash.org](https://blog.jyotiprakash.org/let-only-one-global-live-the-extern-keyword?utm_source=hashnode&utm_medium=feed)

[Raine](https://hashnode.com/@RaineYang) · [Dec 27, 2023](https://hashnode.com/posts/rust-learning-note-global-variable/658c40ba1daa2fa1b0fd851c)

### [Rust Learning Note: Global Variable](https://raine-yang.com/rust-learning-note-global-variable?utm_source=hashnode&utm_medium=feed)

This article is a summary of Chapter 4.7 of Rust Course (course.rs/) Global Variables Initialized at Compile Time Static Constant Static constants are global constants that can be used anywhere in the program, regardless of the scope in which it is d...

3 min read · [raine-yang.com](https://raine-yang.com/rust-learning-note-global-variable?utm_source=hashnode&utm_medium=feed)

[Cup of Solution](https://hashnode.com/@CupofSolution) · [Oct 16, 2023](https://hashnode.com/posts/unlocking-the-power-of-python-variables/652cf85519ad89a4e6344161)

### [Python(Part - 2):Unlocking the Power of Python Variables](https://blog.pritamguha.com/unlocking-the-power-of-python-variables?utm_source=hashnode&utm_medium=feed)

Dive into Chapter 2 of 'Python for Beginners' to unravel the power of variables, a fundamental concept in Python programming.

4 min read · [blog.pritamguha.com](https://blog.pritamguha.com/unlocking-the-power-of-python-variables?utm_source=hashnode&utm_medium=feed)

[Giver Kdk](https://hashnode.com/@Giver) · [Oct 14, 2023](https://hashnode.com/posts/php-function-conditionals-and-scope/652a8062a694de59573e1651)

### [PHP: Function, Conditionals and Scope](https://giver-kdk.hashnode.dev/php-function-conditionals-and-scope?utm_source=hashnode&utm_medium=feed)

Function Definition A function is defined using the 'function' keyword similar to JavaScript. function myFun() { echo "Hello World"; } // Output: Hello World myFun(); Default Parameter The parameters in a function can be given a default value wh...

2 min read · [giver-kdk.hashnode.dev](https://giver-kdk.hashnode.dev/php-function-conditionals-and-scope?utm_source=hashnode&utm_medium=feed)
