I am trying to pass a pointer to a linked list to a function. I want the function to modify the linked list.
In the function, If I print out a member of the structure,it works,but if I try to print...
Type: Posts; User: esmeco
I am trying to pass a pointer to a linked list to a function. I want the function to modify the linked list.
In the function, If I print out a member of the structure,it works,but if I try to print...
I'm using Visual Studio and I'm having a strange problem: each time i try to access the members of a structure with the dot or -> notation,some members don't show up and in some even show up members...
I've added in the add_employee function to test if the code worked
int add_employee(Employee **employee,int n_employees)
{
int i;
n_employees++;
Thank you!I was struggling with that for a long time!
Just one last question: if I wanted to print the contents of each array,how would it look like?Currently I have:
...
I've tried what you said,isolating it,but the "Unhandled Exception...Access Violaton" persists and it only appears when i try to add a second employee...The line of code where it breaks for the...
Unfortunately, no as the number of employees is undefined and that for cycle would limit the call to the function add_employee to 5 times.
The Employee structure in Employee.h:
typedef struct employee
{
char name[100];
int id;
}Employee;
Yes,it's C.
Here it is the main function:
void main()
{
int n_employees=0;
Employee *emp=NULL;
Hello!
I'm having some problems with dynamic arrays passed by reference.
I have an add_employee() function which receives a pointer to a dynamic array of Employee structures.
The purpose of this...
Hello!
Well,like the title says,I was wondering what is the difference between those functions.Don't they do the exact same thing,write data to socket?
Hello!
I have a question regarding typedef use.Why can't we declare a structure like this:
typedef struct
{ int value;
element* next;
Hello!
I'm currently working on a project and I'm having a bit of an hard time with two functions in specific:
Function 1:In this function I want the doctor's number of patients to increase...
Not that I want to,but I must use only pointers!
I'm having some problems iterating through a bidimensional array,as I cn't print all the elements on a matrix form.Here's my code:
#include <stdio.h>
#include <string.h>
#define L1 3...
Thanks for the reply!I guess I really had the containing backwards!
So,basically can we look at structures like we look at classes?Like,for example, ask "questions" like Person IS-A Doctor ,and if...
I'm beggining to work on a project for school which consists in creating a program for managing the pacients and doctors of a clinic.Doctors would have their personal...
Thank you for the tips!
It does work now...But,just one question,why do they get out of scope?
Thank you very much for the explanation and help!Here I've changed a bit the main function and class autoreg taking into account what you've said.
When compiling I get 2 errors of linkage saying the...
Could anyone help me on this?
This's my actual code...I'm having a bit of difficulty about some coding: in class autoreg defined de <map> as public...Should I put them has private instead?Another thing,once I have in autoreg a...
I've read all this and I must say it will give me a giant leap ahead on my work!Very very insightful,thank you so much for all the work!Later tonight,I'll post my code so that you,if possible,give me...
Just one more question that has been aching my head: why would I want to use maps instead of vectors in this case?What are the differences?
Also, if I wanted to,after storing the vehicles' and owners' information, list the owners' information and their owned vehicles how would I do it in terms of coding?
Well,the problem explicitaly says that a car just have one owner...So,regarding to what you've said you could have the association defined by vectors like this:
class Owner { ... }
class...
So if I understood correctly it would be something like:
class Owner
{
private:
...