An array of characters is a string. Stick a '\0' on the end and you can print it just like that with puts, printf, and so forth, as well as strcpy it, etc.
Hi, I'm programming a system in C++ which will send messages from a server to an ip-camera (both are connected to the system). What it does now is take the message from the server-socket and puts it in the camera-socket.
The thing is, after that the camera is going to send a video stream... (1 Reply)
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Hello All,
I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns.
I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions.
If I... (11 Replies)
Hi Experts,
How to sepearate the list digit with letters : with a space from where the letters begins, or other words from where the digits ended.
file
52087mo(enbatl)
52049mo(enbatl)
52085mo(enbatl)
25051mo(enbatl)
The output should be looks like:
52087 mo(enbatl)
52049... (10 Replies)
Hello ,
I am searching a directory for a file and have to assign the filename to a variable .
The variable must have form $$filename
So my code is
echo "'$$filename='`ls -lrt *PreMatch*.csv| head -1 | nawk '{print $9}'`"
however $$ is converting to a number .
How could I make it $$... (3 Replies)
Hi all,
New to this forum.
I have just been reading through a historical thread about some issues with IPMP.
Some tips from "Peasant" where very useful. Please see below
"Just couple of more hints regarding VM.
For VDS, use one VDS - one guest LDOM, don't put everything in primary-vds.... (9 Replies)
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
What are the steps you need to take when you put an old HD in a new computer? I just did this. Every time it makes it to the windows boot screen then restarts. I have a bunch of old engineering software that is not compatible with the newer versions of windows. I figured this out after I bought... (6 Replies)
Discussion started by: cokedude
6 Replies
LEARN ABOUT SUSE
io::string
String(3) User Contributed Perl Documentation String(3)NAME
IO::String - Emulate file interface for in-core strings
SYNOPSIS
use IO::String;
$io = IO::String->new;
$io = IO::String->new($var);
tie *IO, 'IO::String';
# read data
<$io>;
$io->getline;
read($io, $buf, 100);
# write data
print $io "string
";
$io->print(@data);
syswrite($io, $buf, 100);
select $io;
printf "Some text %s
", $str;
# seek
$pos = $io->getpos;
$io->setpos(0); # rewind
$io->seek(-30, -1);
seek($io, 0, 0);
DESCRIPTION
The "IO::String" module provides the "IO::File" interface for in-core strings. An "IO::String" object can be attached to a string, and
makes it possible to use the normal file operations for reading or writing data, as well as for seeking to various locations of the string.
This is useful when you want to use a library module that only provides an interface to file handles on data that you have in a string
variable.
Note that perl-5.8 and better has built-in support for "in memory" files, which are set up by passing a reference instead of a filename to
the open() call. The reason for using this module is that it makes the code backwards compatible with older versions of Perl.
The "IO::String" module provides an interface compatible with "IO::File" as distributed with IO-1.20, but the following methods are not
available: new_from_fd, fdopen, format_write, format_page_number, format_lines_per_page, format_lines_left, format_name, format_top_name.
The following methods are specific to the "IO::String" class:
$io = IO::String->new
$io = IO::String->new( $string )
The constructor returns a newly-created "IO::String" object. It takes an optional argument, which is the string to read from or write
into. If no $string argument is given, then an internal buffer (initially empty) is allocated.
The "IO::String" object returned is tied to itself. This means that you can use most Perl I/O built-ins on it too: readline, <>, getc,
print, printf, syswrite, sysread, close.
$io->open
$io->open( $string )
Attaches an existing IO::String object to some other $string, or allocates a new internal buffer (if no argument is given). The
position is reset to 0.
$io->string_ref
Returns a reference to the string that is attached to the "IO::String" object. Most useful when you let the "IO::String" create an
internal buffer to write into.
$io->pad
$io->pad( $char )
Specifies the padding to use if the string is extended by either the seek() or truncate() methods. It is a single character and
defaults to "