It's implicitly a pointer, implemented as one internally, but the same way you're not allowed to change a string's contents, you're not allowed to change its value. Hardcoded.
Those... aren't really similar things. The array's address (the name) is only known at compile time, or debug info, but in the compiled code the 'name' is effaced and you're simply dealing with addresses hardcoded into the code.
Thus, there isn't really anything you can modify unless you were to write the code segment.
The string, I guess it could also be located in a code segment, but more likely is that they are actual data values in a read-only data segment.
As such, the array is not really a pointer, there is no variable anywhere holding its address. So, it's no different from not being able to change the address of some int value that you have defined.
When you do
That's technically no different from
But I find the biggest annoyance(?) of arrays and structs to be that you can only initialize them at declaration?
I am tring to install Lotus Domino/Notes 5.0.5 on a AIX 4.3.3 server.
I go to run the cdrom/ibmpow/install and I get the following error.
Lotus Notes for Unix Install Program
---------------------------------------------
./install: 10088 Segmentation fault
This had Lotus Notes installed... (1 Reply)
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
If I do this.
Assume
struct life
{
char *nolife;
}
struct life **life;
// malloc initialization & everything
if(life->nolife == 0)
Would I get error at life->nolife if it is equal to 0.
wrong accession? (3 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Hi,
my code is written in proC and it is in UNIX(AIX).I have written a small code for writing data into a binary file,but while writing my program is giving core dump.
Here Is my code----
fpWriteFile = fopen(WriteFileName,"wb+");
CHAR *recvgen;
recvgen = (char... (7 Replies)
void disptree(node *ptr)
{
if ((ptr->left) !=NULL)
disptree(ptr->left);
cout<<"Position:"<<ptr->pos<<" Data:"<<ptr->data<<endl;
if ((ptr->right)!=NULL;
disptree(ptr->right);
}
i'm getting a segmentation fault at the red line. i cannot understand what's the problem.... (3 Replies)
I am working on the application in which I have to fetch values from the database and paste in url and send it to portal.
table=get_result("SELECT serialno,cas,Mode,FLC,TLC,location,CompName,CompCode,FG,FC,DispNo,TruckNo,LWbill,RRGPN,INVNO,DCN,RQTY,DQTY,SQTY,DDATE,RDATE,SDATE,TTIME FROM... (1 Reply)
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
I am getting Segmentation fault at below function call in my script:
get_x() {
sqlplus -s / <<end | grep KEEP | sed 's/KEEP//;s///g'
select 'KEEP' ,table_name from all_synonyms where upper(synonym_name)= '$1';
exit
end
x=$(get_x $1)
echo " SQL OUTPUT IS :: $x"
}
I am getting output of... (1 Reply)
Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1...
I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one.
Below are two very condensed snippets of which I have added the results inside the each code section.
IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
LEARN ABOUT OPENSOLARIS
scds_pmf_restart_fm
scds_pmf_restart_fm(3HA) Sun Cluster HA and Data Services scds_pmf_restart_fm(3HA)NAME
scds_pmf_restart_fm - restart fault monitor using PMF
SYNOPSIS
cc [flags...] -I /usr/cluster/include file -L /usr/cluster/lib -l dsdev
#include <rgm/libdsdev.h>
scha_err_t scds_pmf_restart_fm(scds_handle_t handle, int instance
DESCRIPTION
The scds_pmf_restart_fm() function sends a SIGKILL signal to the fault monitor process tree to kill the fault monitor and then uses PMF to
restart it. This function uses the MONITOR_STOP_TIMEOUT property as its timeout value. That is, scds_pmf_restart_fm() waits at most the
value of the MONITOR_STOP_TIMEOUT property for the process tree to die.
If the MONITOR_STOP_TIMEOUT property is not explicitly set in the RTR file, the default timeout value is used.
One way to use this function is to call it in an UPDATE method to restart the monitor, possibly with new parameters.
PARAMETERS
The following parameters are supported:
handle The handle returned from scds_initialize()
instance For resources with multiple instances of the fault monitor, this integer, starting at 0, uniquely identifies the fault
monitor instance. For single instance fault monitors, use 0.
RETURN VALUES
The scds_pmf_restart_fm() function returns the following:
0 The function succeeded.
non-zero The function failed.
ERRORS
SCHA_ERR_NOERR Function succeeded
See scha_calls(3HA) for a description of other error codes.
FILES
/usr/cluster/include/rgm/libdsdev.h
Include file
/usr/cluster/lib/libdsdev.so
Library
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscdev |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO pmfadm(1M), scha_calls(3HA), signal(3HEAD), attributes(5) , r_properties(5)Sun Cluster 3.2 7 Sep 2007 scds_pmf_restart_fm(3HA)