Thanks for the quick response. It does actually compile on both Linux and AIX ... with or without the #include <stdlib.h>
Not here it doesn't. In C++, undeclared externals are a flat-out error. At the very least it should be a warning, which you the programmer should treat as an error because using undeclared externals indeed mess up very badly on many platforms.
Quote:
So something appears to be going wrong in the way the CrncyFmt function is being called by the main function or the way the CharOut is returned.
Lee
Ahah... When your function returns, the object is no longer in memory, so the memory the string was stored in is no longer allocated and may be overwritten with garbage at any time. It's a sneaky form of returning a pointer to a local variable, disguised enough that the compiler can't warn you about it.
You should pass a buffer into the function to copy the string into instead.
I have a while read loop that reads values inside of a file and then performs an expr operation on each.
Everything works fine, the way it's supposed to but, once the loop is finished, I can not access the variable that I used inside of the loop (but that variable was created outside of the... (7 Replies)
I am trying to write a script that does a useradd -G <group> <user> but you cannot modify the user if he/she is logged on. How could I check to see if the user is on or if the user has been added to the group successfully? I plan on having the script sleep for a couple mins if the user is on then... (3 Replies)
Hi all ,
I am new to HP-UX flavour of unix.
i am issuing simple "vi" comand on the command prompt it is showing me some garbage character in command prompt itself ..unreadable format.
I tried opening an existing file using the vi editor --and same thing
... (3 Replies)
Hi All ,
Please help me in understanding why i am getting error for the below script in LINUX, but the same script will work perfectly in AIX unix.
Script Name:try.ksh
#!/bin/ksh
echo "$0 \n"
MYPWD=$(pwd $(dirname $0))
echo " $MYPWD \n"
O/P in LINUX OS:
./try.ksh
./try.ksh:... (2 Replies)
Hi, has anyone worked with ldmp2v utility to convert a physical machine to a virtual. I am been trying to convert an ultra 45 (test machine) to an ldom on a T6320 blade server (with ldom manager 1.3) but have been unsuccessful.
The firmware of the blade has been upgrade to the latest available.... (0 Replies)
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Hi All,
OS :- HPUX..
I have a following code, which I wrote to meet date and time condition. The below code refuse to work for some reason, I still don't have any idea, why ?
the below code, should exit out, if the day happens to be sat and time greater the 04:00 pm. I am bit surprised, that... (2 Replies)
Hi All,
We have a process which is running for last 2 years well and good in production. But suddenly yesterday there was issue we faced in the process.
The actual process is what it does like below.
1. Receive the files in NAS directory(N/w attached storage).
2. Trigger the... (11 Replies)
Write a script using a Linux shell programming language to perform clock management for a small daycare.
The program should manage all time in and out routines. At the end of the each day should give the Total hours worked that day.
Example:
Time-In 6:30am
Lunch-Out 11 :25am... (1 Reply)
Discussion started by: sarapham409
1 Replies
LEARN ABOUT REDHAT
ne_buffer_finish
NE_BUFFER_DESTROY(3) neon API reference NE_BUFFER_DESTROY(3)NAME
ne_buffer_destroy, ne_buffer_finish - destroy a buffer object
SYNOPSIS
#include <ne_string.h>
void ne_buffer_destroy (ne_buffer *buf);
char *ne_buffer_finish (ne_buffer *buf);
DESCRIPTION
ne_buffer_destroy frees all memory associated with the buffer. ne_buffer_finish frees the buffer structure, but not the actual string
stored in the buffer, which is returned and must be free()d by the caller.
Any use of the buffer object after calling either of these functions gives undefined behaviour.
RETURN VALUE
ne_buffer_finish returns the malloc-allocated string stored in the buffer.
EXAMPLES
An example use of ne_buffer_finish; the duplicate function returns a string made up of n copies of str:
static char *duplicate(int n, const char *str)
{
ne_buffer *buf = ne_buffer_create();
while (n--) {
ne_buffer_zappend(buf, str);
}
return ne_buffer_finish(buf);
}
SEE ALSO ne_buffer(3), ne_buffer_create(3), ne_buffer_zappend(3)AUTHOR
Joe Orton <neon@webdav.org>.
neon 0.23.5 8 October 2002 NE_BUFFER_DESTROY(3)