This is one of those problems that I've always enjoyed because most of the text processing utilities we use have statically defined or user defined limits in moving parts. (Think gawk, perl, etc...).
The Heathfield link is as good an interface as I've seen.
A quick (and easily broken) data structure and some logic for working with the idea.
Hi,
I have the following problem: i must allocate a dynamic array from a subroutine which should return such array to main function. The subroutine has already a return parameter so i thought of pass the array as I/O parameter. I tried the following program but it doesn't work (segmentation... (11 Replies)
I have a program that will fetch some particular lines and store it in a buffer for further operations.The code which is given below works but with some errors.I couldn't trace out the error.Can anybody help on this plz??
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#define... (1 Reply)
I have a scenario like the client has to search for the active server.There will be many servers.But not all server are active.And at a time not more than one server will be active.
The client will be in active state always i.e, it should always search for an active server until it gets one.I... (1 Reply)
i wrote a tiny version of tail command using a large buffer statically allocated but, in a second time, i found another version in which i use a bidimensional array dynamically allocated.
here is the first version
/*my tiny tail, it prints the last 5 line of a file
*/
#include<stdio.h>... (4 Replies)
Hi Experts
I need some help in static memory allocation in C. I have a program in which I declared 2 variables, one char array and one integer. I was little surprised to see the addresses of the variables.
First:
int x;
char a;
printf("%u %u\n', &x, a);
I got the addresses displayed... (2 Replies)
Hello Guys
I have a small confusion in the dynamic memory allocation concept.
If we declare a pointer say a char pointer, we need to allocate adequate memory space.
char* str = (char*)malloc(20*sizeof(char));
str = "This is a string";
But this will also work.
char* str = "This... (2 Replies)
hello all..
i'm a beginner in shell scripting. I need to know what is really happening when we are creating a variable in shell scripting? how memory is allocated for that variable? (3 Replies)
Hello,
I am new to C++ programming, so I'm still getting a feel for things. I recently wrote a simple C++ program (to be used as a ROOT Macro) to conduct a statistical analysis of a varied version of the Monty Hall problem (code below). Basically, the programs runs a few simple calculations to... (7 Replies)
Discussion started by: Tyler_92
7 Replies
LEARN ABOUT DEBIAN
px_retrieve_record
PX_RETRIEVE_RECORD(3) Library Functions Manual PX_RETRIEVE_RECORD(3)NAME
PX_retrieve_record -- Returns record in Paradox file
SYNOPSIS
#include <paradox.h>
pxval_t ** PX_retrieve_record(pxdoc_t *pxdoc, int recno)
DESCRIPTION
Returns the record with the given number in a Paradox file. The first record has number 0, the last one has number_of_records-1.
If you are accessing several records, do it in ascending order, because this is the most efficient way.
The return value is an array of field values. Each value is stored in a structure like the following:
typedef struct px_val pxval_t;
struct px_val {
char isnull;
int type;
union {
long lval;
double dval;
struct {
char *val;
int len;
} str;
} value;
};
The element isnull is set to 1 if the value is NULL otherwise it is set to 0. type is the type of the paradox field as
defined in paradox.h. A field value can be either a long int, a double or a string, depending on the paradox field type. The paradox field
types pxfShort, pxfLong, pxfDate, pxfTime, pxfLogical, and pxfAutoInc are returned as long int values. pxfTimestamp, pxfNumber, and
pxfCurrency are returned as double values and all remaining paradox field types are stored as strings with the length in value.len. You can
rely on strings being Null terminated. Blobs are stored as string but are not guarented to be Null terminated.
The paradox field types pxfTimestamp, pxfTime, an pxfDate use an uncommon format which can be converted into a string with PX_time-
stamp2string(3), PX_time2string(3), and PX_date2string(3).
RETURN VALUE
Returns a pointer on success and NULL on failure.
SEE ALSO PX_update_record(3), PX_timestamp2string(3), PX_time2string(3), PX_date2string(3)AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx.
PX_RETRIEVE_RECORD(3)