why did you not post function insert() ? Is that the function you have the question about?
if you want to copy one structure into another you can use memcpy() function to copy everything in one bang.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
it is possible you could use a default constructor to set the fields of your object:
struct proceso
{
char name[20];
char memory[10];
char time[10];
char files[10];
//constructor
<strong>proceso();</strong>
};
//Function Definition
proceso::proceso()
{
strcpy(name = Doom3);
strcpy(memory = 1212);
strcpy(time = 14);
strcpy(files = 2);
}
The constructor will set the according attributes for each new creation of an instance of the 'proceso' object.
Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 118
it is possible you could use a default constructor to set the fields of your object:
struct proceso
{
char name[20];
char memory[10];
char time[10];
char files[10];
//constructor
<strong>proceso();</strong>
};
//Function Definition
proceso::proceso()
{
strcpy(name = Doom3);
strcpy(memory = 1212);
strcpy(time = 14);
strcpy(files = 2);
}
The constructor will set the according attributes for each new creation of an instance of the 'proceso' object.
that constructor is totally wrong. you need to compile code before posting to make sure it will work.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343