Sponsored Content
Full Discussion: static variable storage
Top Forums Programming static variable storage Post 302281437 by shamrock on Wednesday 28th of January 2009 11:41:46 PM
Old 01-29-2009
Quote:
Originally Posted by naan
Hi,

Where are the static variables actually stored in memory. Is it in .bss? In that case how is its storage different from global variables?
Static variables are persistent for the duration of the program and are stored on the heap. The uninitialized ones are located in the bss section of the heap.
Quote:
Originally Posted by naan
From the ELF data is it possible to see the storage of different variables used in the program?

eg:

static int temp1;
int gtemp1;

main() {
static int temp2;
.
.
}

In this code segment, are both temp1 and temp2 stored in .bss?
temp1 and temp2 will be located in the bss section of the heap as would be gtemp1 unless they were explicitly initialized.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Static variable in shell

Hi All, I want a static variable in shell script. I have a script in which I want to send mail on certain condition and it happens that when that condition is met it start mailing as i have set my cron job to execute every 15 mins. And what i want is to run that script after every 15... (1 Reply)
Discussion started by: Yagami
1 Replies

2. Shell Programming and Scripting

Static variable in shell

Hi All, I want a static variable in shell script. I have a script in which I want to send mail on certain condition and it happens that when that condition is met it start mailing as i have set my cron job to execute every 15 mins. And what i want is to run that script after every 15... (4 Replies)
Discussion started by: Yagami
4 Replies

3. IP Networking

I need HELP to Set up Coyote Linux router with 1 static IP & 64 internal static IP

hello, i need help on setting my coyote linux, i've working on this for last 5 days, can't get it to work. I've been posting this message to coyote forum, and other linux forum, but haven't get any answer yet. Hope someone here can help me...... please see my attached picture first. ... (0 Replies)
Discussion started by: dlwoaud
0 Replies

4. Shell Programming and Scripting

Merge Static and dynamic parts in variable declaration

Dear Unix experts I want to define a variable which contains dynmic and static part, daynamic part is the first field. Sample of data dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423 werwer nawk 'BEGIN {FS=" "}{... (4 Replies)
Discussion started by: yahyaaa
4 Replies

5. Emergency UNIX and Linux Support

Merge Static and dynamic parts in variable declaration

Dear Unix experts Moved from "Shell Programming and Scripting " I want to define a variable which contains dynmic and static part, daynamic part is the first field. Sample of data dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423... (2 Replies)
Discussion started by: yahyaaa
2 Replies

6. Programming

C++ program is crashing on re-assigning const static member variable using an int pointer

Hi, Can any one tell me why my following program is crashing? #include <iostream> using namespace std; class CA { public: const static int i; }; const int CA::i = 10; int main() { int* pi = const_cast<int*>(&CA::i); *pi = 9; cout << CA::i << endl; } (6 Replies)
Discussion started by: royalibrahim
6 Replies

7. Programming

Synchronization Variable Storage

We know that all the threads in process share the process address space. We have various synchronization mechanisms like semaphore, mutex, spinlock, critical sections etc . used for thread syncronization. I want to know in which part of the process address space are these synchronization... (2 Replies)
Discussion started by: rupeshkp728
2 Replies

8. Shell Programming and Scripting

Variable storage using awk

Hi, there is a file which contains some values in column format. I want to store those values in a variable.but when i am using awk it is storing all the values at a time. x=`awk '{print $1}' test2.txt` echo $x ab cd mn jk yt but i want the values to be stored one by one in that variable.... (3 Replies)
Discussion started by: arijitsaha
3 Replies
GLSHADERSTORAGEBLOCK(3G)					   OpenGL Manual					  GLSHADERSTORAGEBLOCK(3G)

NAME
glShaderStorageBlockBinding - change an active shader storage block binding C SPECIFICATION
void glShaderStorageBlockBinding(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); PARAMETERS
program The name of the program containing the block whose binding to change. storageBlockIndex The index storage block within the program. storageBlockBinding The index storage block binding to associate with the specified storage block. DESCRIPTION
glShaderStorageBlockBinding, changes the active shader storage block with an assigned index of storageBlockIndex in program object program. storageBlockIndex must be an active shader storage block index in program. storageBlockBinding must be less than the value of GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS. If successful, glShaderStorageBinding specifies that program will use the data store of the buffer object bound to the binding point storageBlockBinding to read and write the values of the buffer variables in the shader storage block identified by storageBlockIndex. ERRORS
GL_INVALID_VALUE is generated if attribindex is greater than or equal to the value of GL_MAX_VERTEX_ATTRIBS. GL_INVAILD_VALUE is generated if bindingindex is greater than or equal to the value of GL_MAX_VERTEX_ATTRIB_BINDINGS. GL_INVALID_OPERATION is generated if no vertex array object is bound. ASSOCIATED GETS
glGet() with arguments GL_SHADER_STORAGE_BUFFER_BINDING, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS, GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS, GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS, GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS or GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, or GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES. COPYRIGHT
Copyright (C) 2012 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. AUTHORS
opengl.org opengl.org 06/10/2014 GLSHADERSTORAGEBLOCK(3G)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy