Sponsored Content
Top Forums Programming putting numbers behind eachother Post 302556764 by shamrock on Monday 19th of September 2011 12:19:34 PM
Old 09-19-2011
Null terminate the char array and then just printf("%s\n", buf)...and if you dont know howto null terminate a char array readup on the C language first.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Putting pC on network

How do I put a my PC with linux 7.0 on a class B network. Can someone give me info or text that will guide me? (1 Reply)
Discussion started by: Rush
1 Replies

2. IP Networking

Link two sockets to eachother

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)
Discussion started by: Eckhardt
1 Replies

3. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

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)
Discussion started by: thepurple
6 Replies

4. Shell Programming and Scripting

the smallest number from 90% of highest numbers from all numbers in file

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)
Discussion started by: Apfik
11 Replies

5. UNIX for Dummies Questions & Answers

Print numbers and associated text belonging to an interval of numbers

##### (0 Replies)
Discussion started by: lucasvs
0 Replies

6. Shell Programming and Scripting

Help awk/sed: putting a space after numbers:to separate number and characters.

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)
Discussion started by: rveri
10 Replies

7. UNIX for Dummies Questions & Answers

Putting $$ before filename

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)
Discussion started by: Pratik4891
3 Replies

8. Solaris

Guest LDOMS on same subnet cant ping eachother

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)
Discussion started by: selectstar
9 Replies

9. UNIX for Beginners Questions & Answers

Decimal numbers and letters in the same collums: round numbers

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)
Discussion started by: echo manolis
7 Replies

10. Hardware

Putting an old hd in a new computer

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
bufsplit(3GEN)					     String Pattern-Matching Library Functions					    bufsplit(3GEN)

NAME
bufsplit - split buffer into fields SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ] #include <libgen.h> size_t bufsplit(char *buf, size_t n, char **a); DESCRIPTION
bufsplit() examines the buffer, buf, and assigns values to the pointer array, a, so that the pointers point to the first n fields in buf that are delimited by TABs or NEWLINEs. To change the characters used to separate fields, call bufsplit() with buf pointing to the string of characters, and n and a set to zero. For example, to use colon (:), period (.), and comma (,), as separators along with TAB and NEWLINE: bufsplit (":., ", 0, (char**)0 ); RETURN VALUES
The number of fields assigned in the array a. If buf is zero, the return value is zero and the array is unchanged. Otherwise the value is at least one. The remainder of the elements in the array are assigned the address of the null byte at the end of the buffer. EXAMPLES
Example 1: Example of bufsplit() function. /* * set a[0] = "This", a[1] = "is", a[2] = "a", * a[3] = "test" */ bufsplit("This is a test ", 4, a); NOTES
bufsplit() changes the delimiters to null bytes in buf. When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in mul- tithreaded applications. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.10 29 Dec 1996 bufsplit(3GEN)
All times are GMT -4. The time now is 03:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy