A fairly basic question, but I don't see it asked anywhere.
Let's say we have a global struct (in C) like so:
struct foo {
int written_frequently1;
int read_only;
int ...
|
How can I do something like that (just an example):
any_struct *my_struct = create_struct();
add_struct_member(my_struct, "a", int_member);
add_struct_member(my_struct, "b", float_member);
So that I could load and use a struct instance "from the outside" (at the ... |
I'm attempting to write a structure consisting of a an array of characters, an integer value, and a pointer to a pipe. The structure represents a node in a singly linked ... |
I'm trying to pass structs between processes using named pipes. I got stuck at trying to open the pipe non-blocking mode. Here's my code for writing to the fifo:
void writeUpdate() {
...
|
I have a very simple compound dataset, about 1 million rows of a compound datatype:
1 long, 3 doubles.
I would like to read it in parallel with MPI using a collective call, ... |
Is it possible to send and recieve a structure with SSL_write and SSL_read?
Client
typedef struct{
unsigned int userid;
unsigned int name; ...
|
Hi everyone, I have been mucking about trying to read PE header information. I know (and use) several very nice PE dumpers, among them PEInfo. I'm trying to write C that will contain some of their functionality. In particular, I would like to be able to read the information in the imports section. I am stalled trying to find the IMAGE_IMPORT_DESCRIPTOR ... |
|
|
|
Code: #include #include #include static int count = 0; struct test { int age; char name[1000]; }; void writeToStruct(struct test **ptr) { int i,size_struct=0,len = 0; struct test *p = NULL; struct test *q = NULL; struct test *t = NULL; char name[1000]; if ( count != 2 ) { size_struct = sizeof(test)*(++count); len = sizeof(test); p = (struct test *)malloc( ... |
Well, yes, at the very start of the program (sorry if I didn't explain it), my structure is filled by reading a .dat that contains all the informations of the inventory and then the already existing bills. Here it is: Code: paraplbleu01 50 12.25 V paraplbleu02 40 12.50 V paraplroug01 30 10.74 V paraplvert01 25 9.53 V bottesjaun01 45 9.99 V ... |
|
|
|
Can some one help me with a querie, i have three structures listed below and i need to access them then run several validation tests, i'm going to use while(fscanf( some_fp, "%c %s %s %d",I_R_RECORD.rec_type, I_R_RECORD.cust_code, I_R_RECORD.part_num, I_R_RECORD.quantity) !=EOF) to read the structure/s. Th question being can i access them all within one while(fscanf()), or do i have to fscanf() the ... |
i see Scorpions4ever you say (correct me please), for( ; ; ){ - translate the well known c-struct into a char-string and send in (does not matter how) to tcl - tcl split this string in his own struct, work on it, make changes .... translate it in char-str and send answer to c-server - c-server translate the comming string in ... |
You aren't clear in what you want. When you're reading data from stdin with normal library functions, it becomes available in the buffer when a newline is entered. You may pluck it out of there in a number of different ways and stash it in a structure at your pleasure. I'm not sure you are distinguishing between what's going on during ... |
Lets say I have two processes connected by a pair of pipes (one for writing the other for reading). Further more lets say I have a structure declared: typedef struct { int x int y .. .. } myStruct; Ok, my problem is that I can not send an instance of the structure over the pipe and have it preserve the ... |
I have been trying to convert an old utility from dos to win32 but have come unstuck when reading a file into a struct, It works fine when its in the original program but it doesnt work here. Are there any changes i should make or ways to debug and find out exactly what is going on. struct rdrtype_50 { int ... |
|
How do i wrtie more than one structure to a same file and then read it? Here is a sample program i wrote.Tell me whats wrong with it #include #define WRD 2 typedef unsigned char byte; typedef struct { byte hr; byte trans_no[WRD]; ... |