Hi,
is there any command to see symbol table info.
will it show where its allocating memory for varibales golbals & locals and code.(i mean the segments).
i read there is a section called read only data segment and this is where initialized data such as strings stores.
i have wriiten the following program and its giving segmentation for strings but not others.
---------- Post updated at 08:25 AM ---------- Previous update was at 08:16 AM ----------
The problem of that code is that 'p' symbol is stored in a not writable data segment because it is defined as a constant.
If you compile that code, for example, with:
'p' symbol is stored in a writable data segment and the program will be ok, but this option might be removed in a future release of G++.
MrUser, your code is problematic. Consider the following 2 statements:
In the first statement, a mutable (modifiable or non-constant) string p is declared as an array of character and initialized with the string "test". The size of array p is 5 bytes including a null terminator. The result of *p = 'T' is defined and works as expected.
In the second statement an immutable (AKA constant) string litteral is declared and the base address of the memory where the compiler stores the string litteral is assigned to the pointer variable p. In this case, the result of *p = 'T' is undefined as you found out.
When you want a mutable string, i.e. a string which can be modified, use initialization instead of assignment.
Hi,
I am a newbie in Linux land, and I have a question about programming parent/child process interaction:
How do I search the value of a symbol in the child process? Is it possible?
I am doing a fork() and execve() to spawn any child possible, and I need something on the parent side to... (12 Replies)
Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer:
<script>
$(function(){
$('tr, td, fieldset,... (0 Replies)
I am new to this shell scripting....
I have a file which contains list of users. This files get updated when new user comes into the system.
I want to create script which will give a table containing unique list of users. When I say unique, it means script should match table while parsing... (3 Replies)
Hello,
I'm working with putty on Windows 7 professional and I'd like to know if there's a way to gather specific lines from a pre-existing table and make a new table with that information.
More specifically, I'd like the program to look at a specific column, say column N, and see if any of the... (5 Replies)
Hi
I was wondering how can a c program will be implemented which will display a symbol while calculating something.
for example : program should display some charters like /\/\ while calculating.
At least provide some pointers
thanks (4 Replies)
Folks,
I have some program(Test.cpp) as follows,
#include<iostream>
class Abc
{
private:
int _theVar;
public :
int printVar();
};
int Abc :: printVar()
{
_theVar=10;
}
main()
{
Abc _t; (2 Replies)
Folks,
I have some program(Test.cpp) as follows,
#include<iostream>
class Abc
{
private:
int _theVar;
public :
int printVar();
};
int Abc :: printVar()
{
_theVar=10;
}
main()
{
Abc _t; (0 Replies)
Hi@all,
I try to compile c code on hpux 11.11 pa-risc 2 with gcc (32bit). I compile with the option -g, so that I get the symbol table, but it is not available. Does someone knows something on this?
thx (2 Replies)