pass the variable contain
Hi all,
I try to pass the variable's contain for != functions. I have an structure Code:
struct struc_user { Like Code:
printf("Which is your nick? \n"); Code:
room(); |
Irios, I suppose English is not your native language, but this is really difficult to understand.
I assume with 'contain' you mean 'contents'. The value of where the pointer point at. But what is != function. Can you try to explain that with words and examples? jlinkels |
Well, when I write != i mean different(like c lol). In other words i want to pass value variable in differents functions. I write in my first thread some examples of pseudo-code.
I need help ! |
Do you want to pass the contents of, say, "username" for a particular user (i.e. element of your users array) to some function? You use the same array syntax as normal to access elements of the array and the . operator to access members of the structure. Here's an example:
Code:
struct struct_user |
Quote:
If I have this structure Code:
int n_user; Code:
puts("Which is your username?"); username[1]="kevin" username[2]="bob" username[3]="mark" . . -and how can i call each username in different functions, I mean: room(); read_nick(); . . |
Quote:
Code:
users[n_user].username Quote:
Code:
room (&users[1].username) |
users[n_user].username = "kevin"
users[n_user].username = "root" Is ok this way ??? |
It looks good. n_user is an integer < 100 of course
|
All times are GMT -5. The time now is 07:49 AM. |