Memory that came from an extinct process gets blanked before anything else gets it.
What may be different is different arrangements of the stack frame, and the like. With the compiler options you have that days (stack protectors, etc) it can vary quite a bit.
I knew about undefined memory areas.
What is confusing me is when you do some implicit definitions like
So, as corona said, somehow my pointers should have already been initialized to some available memory area.
And this has consistently been the case on a single machine.
It consistently wasn't on another two machines.
I knew about undefined memory areas.
What is confusing me is when you do some implicit definitions like
So, as corona said, somehow my pointers should have already been initialized to some available memory area.
And this has consistently been the case on a single machine.
It consistently wasn't on another two machines.
Um, no. I was telling you that what you were doing is wrong, not that what you were doing ought to work.
Let me put it this way.
"some text" becomes valid memory when compiled. That text has to get into the program somehow, right? (It's unwritable memory, fyi, so if you try and edit it you'll get a surprise.) It's not an implicit strcpy. The memory already exists and will exist for the entire duration of the program. You do not need to copy the string to have it.
The pointer itself, though? Until you make it point to anything valid, can point to valid or invalid memory, depending wholly on chance and undefined things.
So lets compare your two methods of assignment:
Last edited by Corona688; 01-11-2013 at 11:51 AM..
Can anyone explain why wc is behaving weirdly? Their are only 2 occurrences but wc thinks their are 7 occurrences. I have even manually checked this.
$ grep -i base *
lit: base xx
lit.lst:003- 00103 BASE XX
$ grep -i base * | wc -w ... (2 Replies)
Hi,
Immediate help on below will be appreciated.
I have to read a file (max of 10MB) which will have no new line characters, i.e. data in single line. and have to inster '\n' at every 100 characters. and if record starts with 'BUCA' then need to pick value of length 10 at position 71 and... (7 Replies)
Hello. I need upgrade memcached. This software is installed throuth yum. In official repositories isn`t newest version of memcached, but this one is vulnerable. So looks like I need built it from source, but I dont really want to install c libraries un compilers on system.
1.) So can I compile... (0 Replies)
I have two servers on same domain. one can nslookup other cannot
Psu100 can lookup to psu000, psu010 & psu011
Psu110 can NOT lookup to psu000, psu010 & psu011
I verified resolv.conf entries on both psu000 and psu010 and it contains both name servers (10.200.10.21 & 10.200.11.22).I am... (1 Reply)
Hi Gurus,
I tried FTP one file to UNIX which got values like
wel^come
If I see the content in unix, it shows like
wel^Zcome
^ coverted into ^Z (Control + Z )
Can someone please share what is happening here?
Thanks,
Shahnaz (5 Replies)
Im trying to execute the below command on our server to list files and replace the newline in the file list with spaces, but the character 'n' is getting replaced with a space, is there any environment variable that needs to be set in UNIX?
sh -c 'ls -trx... (1 Reply)
I have a set up of 5 machines which are connected in same network.
Now i want to run a small application so that those machines are not ideal. (0 Replies)
I have a large file with the first 2 characters of each line determining the type of record. type 03 being a subheader and then it will have multiple 04 records.
eg: 03,xxx,xxxx,xxxx
04,xxxxxxxxxxxxxxxxxxxxxxxxxxxx
04,xxxxxxxxxxxxxxxxxxxxxxxxxxxx
03,xxx,xxx,xxx
... (2 Replies)
Hi,
I am working on a custom made FTP application. The application is behaving erratically for the "ls" command. Wild card character passed to the "ls" command (like "ls *temp") is giving inconsistent results. On debuggin I have found that the "ls" command is implemented as shown below in the... (7 Replies)