int i = 10;
int main()
{
int i = 20;
return 0;
}
Hi All,
I want to access the global variable i inside the main. Is there
a way to do this in C?
Regards,
Mohan.
Nov 14 '05
44 2043
In article <io************ *************** *****@4ax.com>,
Mark McIntyre <ma**********@s pamcop.net> wrote: On Sat, 21 Aug 2004 18:07:37 GMT, in comp.lang.c , ga*****@yin.in teraccess.com (Kenny McCormack) wrote:
(stuff)
Troll alert.
troll, n., (Incorrect, but common among the lower classes, definition
follows): Someone I disagree with.
On Mon, 23 Aug 2004 14:29:40 GMT, in comp.lang.c , ga*****@yin.int eraccess.com (Kenny McCormack) wrote: In article <io************ *************** *****@4ax.com>, Mark McIntyre <ma**********@s pamcop.net> wrote:On Sat, 21 Aug 2004 18:07:37 GMT, in comp.lang.c , ga*****@yin.i nteraccess.com (Kenny McCormack) wrote:
(stuff)
Troll alert.
troll, n., (Incorrect, but common among the lower classes, definition follows): Someone I disagree with.
_______________ ______
/| /| | |
||__|| | Please do not |
/ O O\__ | feed the |
/ \ | Trolls |
/ \ \|_____________ ________|
/ _ \ \ ||
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | _||
/ / \ |____| ||
/ | | | --|
| | | |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ | ||
/ _ \\ | / `
* / \_ /- | | |
* ___ c_c_c_C/ \C_c_c_c_______ _____
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
In article <eo************ *************** *****@4ax.com>,
Mark McIntyre <ma**********@s pamcop.net> wrote: On Mon, 23 Aug 2004 14:29:40 GMT, in comp.lang.c , ga*****@yin.in teraccess.com (Kenny McCormack) wrote:
In article <io************ *************** *****@4ax.com>, Mark McIntyre <ma**********@s pamcop.net> wrote:On Sat, 21 Aug 2004 18:07:37 GMT, in comp.lang.c , ga*****@yin. interaccess.com (Kenny McCormack) wrote:
(stuff)
Troll alert.
troll, n., (Incorrect, but common among the lower classes, definition follows): Someone I disagree with.
_______________ ______ /| /| | | ||__|| | Please do not | / O O\__ | feed the | / \ | Trolls | / \ \|_____________ ________|
Um, talking to yourself, are you?
If, by your lights, I'm a troll, then aren't you ignoring your own advice? ga*****@yin.int eraccess.com (Kenny McCormack) writes: In article <eo************ *************** *****@4ax.com>, Mark McIntyre <ma**********@s pamcop.net> wrote:On Mon, 23 Aug 2004 14:29:40 GMT, in comp.lang.c , ga*****@yin.in teraccess.com (Kenny McCormack) wrote:
In article <io************ *************** *****@4ax.com>, Mark McIntyre <ma**********@s pamcop.net> wrote: On Sat, 21 Aug 2004 18:07:37 GMT, in comp.lang.c , ga*****@yin. interaccess.com (Kenny McCormack) wrote:
(stuff)
Troll alert.
troll, n., (Incorrect, but common among the lower classes, definition follows): Someone I disagree with.
_______________ ______ /| /| | | ||__|| | Please do not | / O O\__ | feed the | / \ | Trolls | / \ \|_____________ ________|
Um, talking to yourself, are you?
If, by your lights, I'm a troll, then aren't you ignoring your own advice?
Troll! No, you're a troll! Am not! Are too! Are not! Am too!
TROLLTROLLTROLL TROLLTROLLTROLL TROLLTROLLTROLL TROLLTROLLTROLL TROLL
(Anyone who hasn't been a troll is encouraged to assume that my
ridicule is not directed at them.)
Followups redirected appropriately.
--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Kenny McCormack wrote: Mark McIntyre wrote:
[snip] Um, talking to yourself, are you?
If, by your lights, I'm a troll, then aren't you ignoring your own advice?
Hi Kenny,
Mark McIntyre is one of our indigenous trolls.
Please ignore him. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tim Tyler |
last post by:
PHP puts most of its functions into a big flat global namespace.
That leads to short function names - but creates a namespace
minefield for programmers.
Lots of the functions are legacies from the days before PHP
got object-oriented features.
For instance we currently have:
|
by: Fernando Rodríguez |
last post by:
Hi,
I haven't used Python in quite some time, and I'm bit puzzled by this:
counter = 0
class Blah(object):
def run(self):
counter += 1
|
by: C Gillespie |
last post by:
Dear All,
I have 2 arrays
var A1 = new Array();
A1 ="Y2";
var B1 = new Array();
B1 ="Y1";
B1 ="sink";
|
by: Capstar |
last post by:
Hi,
I am working on an application, which will run embedded without an OS.
The app is build up out of a couple of well defined parts. At first I
wanted to keep those parts seperated and use opaque data types to
transfer information in between them.
At some stage I was stuck and needed to make a variable global, and I
also needed to make the struct declaration public to some other parts.
Looking through the code I found out that lots...
|
by: Shilpa |
last post by:
Hi,
I just wanted to know whether we can access global variable within a
local block , where both variables are having same name.
For ex:
int temp=5 ;
{
int temp=10;
| |
by: Ed Jensen |
last post by:
I'm having a vexing problem with global variables in Python. Please
consider the following Python code:
#! /usr/bin/env python
def tiny():
bar =
for tmp in foo:
bar.append(tmp)
foo = bar
|
by: weaknessforcats |
last post by:
C++: The Case Against Global Variables
Summary
This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have called it polluting the global namespace. This article explores what happens when the global namespace becomes polluted and how to avoid this condition.
The opinions expressed in this article are those of the author alone although many have...
|
by: istillshine |
last post by:
When I control if I print messages, I usually use a global variable
"int silent". When I set "-silent" flag in my command line
parameters, I set silent = 1 in my main.c.
I have many functions that may print some messages.
foo(...)
{
if (!silent)
|
by: Dheeraj Joshi |
last post by:
Hi, I was wondering is there any technique available, so we can access the global variable inside a function if we have a local variable inside the function with the same name as global variable.
Example
#include<something.h>
int countVal = 100;
/*
Some stuff
*/
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |