ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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:
int n_user;
struct struc_user {
int *number_user;
char username[20];
} users[100];
right, and I stored each username with
Code:
puts("Which is your username?");
fgets(users[n_user].username, sizeof(users[n_user].username), stdin);
-How can I identify which username is (logon) ?
username[1]="kevin"
username[2]="bob"
username[3]="mark"
.
.
-and how can i call each username in different functions, I mean:
room();
read_nick();
.
.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.