Search Result

Collapse
19 results in 0.0015 seconds.
Keywords
Members
Tags
struct
  •  

  • dragneel
    started a topic invalid use of incomplete type struct...
    in C

    invalid use of incomplete type struct...

    I have this error.
    "Invalid use of incomplete type struct Operand forward declaration of struct Operand". i got the same error some days ago, so i asked somewhere but the code was correct and i resolved creating again those files. But now i have again this error and i can't get rid of it :( I have this error in these 2 files.

    barrel.h
    Code:
    #include "operand.h"
    #include <string>
    using
    ...
    See more | Go to post

  • Can't assign value to structure in a class instance?

    Can't assign value to structure in array? this discussion was going on here some time ago without satisfactory conclussion at least from my point of view. here is my answer:
    i have come cross a similar problem when having a struct representing id3 tag being part of node which was class instance .. later when i wanted to change value of that id3 tag; from the code eg.

    Mp3Node node = treeView1.Activ eNode;
    node.tag = new...
    See more | Go to post

  • Cagin
    started a topic C - Macro problem with nested structures
    in C

    C - Macro problem with nested structures

    I define a macro like this:

    Code:
    #define L(p) ((p).value.len)
    
    typedef struct node
    {
    	int dimension;
    	int position;
    	int size;
    
    	union 
    	{
    	    long len;
    	    float f;
    
    	    } value;
    
    	struct node *prev;
    	struct node *next;
    
    } node, *np;
    and later,when I try to use that macro,
    I have this error:
    ...
    See more | Go to post
    Last edited by Banfa; Jun 16 '11, 11:06 AM. Reason: Removed the extra blank lines

  • mahmoodn
    started a topic passing a non string type to "fputs"
    in C

    passing a non string type to "fputs"

    Hi
    I have a struct
    Code:
    struct b_entry_t {
       uint32_t source;  
       uint32_t target;
       int counter;  
    };
    and I have created an instance of that
    Code:
    struct b_entry_t *entry;
    Somewhere in my program I want to write it to file with fputs. The problem is how can I do that?
    Code:
    fputs (entry, pFile);
    I get this warning
    Code:
    warning: passing argument 1 of ‘fputs’
    ...
    See more | Go to post

  • How to read user input into a struct and add to a csv file?

    Hi all,

    I am trying to use the variables I have in the struct to store user input about a car.

    Code:
    struct CarC
    {
    	string carRegistration;
    	string carOwner;
    	string carOwnerAddress;
    	string carManufacturer;
    	string carModel;
    	unsigned numCarDoors;
    	unsigned numCarSeats;
    	string carType;
    	string carInformation;
    };
    ...
    See more | Go to post

  • reubinoff
    started a topic problem with void* in struct
    in C

    problem with void* in struct

    hello,
    I have some problem with my project in C. I want do define a generic type of matrix. with this type I can save any kind of type(int, double, float...). but I have some errors in my code. if someone can help me I'll be very gratefull. the code is:
    Code:
    typedef struct arr{
    	void * p_arr;
    }arr;
    
    typedef struct matrix{
    	
    	arr  * p_mat;
    	char* name;
    	int size_h;
    	int
    ...
    See more | Go to post

  • robintux
    started a topic How access to struct in .h , from my principal program
    in C

    How access to struct in .h , from my principal program

    i'm writing a header , from define a struct.

    The question is , how declare this struct in my main.c .

    function.c
    Code:
     struct data{
           size_t n;
           gsl_vector  *y;
         };
    function.h
    Code:
    /*here should be the struc data*/
    ?????
    main.c
    Code:
    #include "function.h"
    	struct data d = { n, y 	};
    Errors...
    See more | Go to post

  • EnlightenedOne
    started a topic Marshalling data to a char array
    in C

    Marshalling data to a char array

    Hey there I have a data structure with a set size of 40 I want to marshall the data from an object into an array of characters for simplistic transmission of data. I am aware of serialization but only familiar with it in higher languages, I am stuck using c.

    My question is this. How do I point to an individual character value of the unmarshalled object in order to marshall it into a character array I can throw down the socket pipe?...
    See more | Go to post

  • Changing the address of a New struct in a loop?!

    Hi guys,
    i'm writing a simple code which is about polynomials using link lists in C#. the problem i have is that whenever it creates a new struct (node) in the for loop it gives it the same address as the previous node was given. so how do i fix it ? here is my struct :

    struct poly { public int coef; public int pow; public poly* link;} ;

    and here is the where the problem occurs:


    for (;...
    See more | Go to post

  • miner
    started a topic Passing a pointer to a function ... how?
    in C

    Passing a pointer to a function ... how?

    Hi all

    I'm doing my first steps in C and I need some help plz.

    I have 2 structs, a node* and a stack*. I want to write a push() function that accepts to arguments, the node to insert and the pointer to the the top of the stack.

    This way it works without problems: push(node *theNode, stack *theStack)
    The call looks like that: push(newNode, newStack) and inside the function I can access the pointer...
    See more | Go to post

  • EARNEST
    started a topic Struct, char array and pointer problem.
    in C

    Struct, char array and pointer problem.

    Code:
    #include <string.h>
    #include <ncurses.h>
    #include <time.h>
    #include <stdlib.h>
    
    typedef struct builder{
    	int locX;
    	int locY;
    	char charValue_H;
    	char charValue_T;
    	char *charArray_B;
    } sbuilder;
    
    void drawborders();
    void initialize(sbuilder *stopass);
    bool collisiondetection();
    
    int main()
    {
    ...
    See more | Go to post

  • Why pack_into doesn't write correctly some bytes?

    When I try to write a specific byte (letter 'p') in a writable buffer using pack_into the result is a corrupted data:

    Code:
    >>> from ctypes import create_string_buffer
    >>> from struct import pack_into
    >>> test = create_string_buffer(1)
    >>> pack_into("B", test, 0, 48)
    >>> print repr(test.raw)
    '0'
    The answer should be '\x30'....
    See more | Go to post

  • mike91
    started a topic read text file into formatted struct array
    in C

    read text file into formatted struct array

    Hello,
    I have a text file of unknown size that I need to read into a struct array where the struct looks like :
    {
    short hours
    float secondsPastHour
    float data1
    float data2
    }

    But the text file is in the format
    hh:mm:ss data1 data2

    I have an array of the struct and I need each line in the text file to be read into one record of the array. I know how to...
    See more | Go to post

  • DOSASIS09
    started a topic How sort and do a list after giving struct?
    in C

    How sort and do a list after giving struct?

    Hello, im not an inexpert guy programming and I need to do an application in c, that I declare using a structure 3or4 structures predefined. After that I need to sort this 3 or 4 strucutres “tasks” depends on the parameter of the priority in each structure. I would like to read the structures and then do a sort list with the ID of the task, but depending on the PRIORITY of each task. I don’t know how many pointers I should use.I understand...
    See more | Go to post

  • kiser89
    started a topic malloc array of structs + a little more
    in C

    malloc array of structs + a little more

    I'm having a problem with my array of structs and segmentation faults. I have this struct that represents one line of a source file:
    Code:
    struct threeTokens {
    int lineNumber;
    char* cmd;
    char* param;
    }; line;
    This is the code that tries to fill the array of structs, which is a global variable called program:
    Code:
    program = malloc(numLines * sizeof(line));
            while(NULL != fgets(buffer, SIZE, fp)){
    ...
    See more | Go to post
Working...