By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,154 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,154 IT Pros & Developers. It's quick & easy.

program to print company name on giving mobile no..??

P: 1
hiiiiiiiii..

i am lerning c language...i have some problem...

i want to make program in c language...
in which user enter his name ,address,mobile number..

when he enter mobile no..in output screen..it show the name of mobile no company..like airtel,reliance.vodafone,hutch..

kindly help me please...
Aug 28 '10 #1
Share this Question
Share on Google+
2 Replies


100+
P: 542
How are the mobile numbers related to the company names?
Aug 29 '10 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
What you need is a struct for the mobile. In that struct you have the mobile number aand the company. You create a variable for the mobile number.

Then design a struct for your user. In that struct add a member that it a pointer to a mobile. Then when you create a user variable you add insert the address of the mobile variable.

This allows you to add values to the user struct variable and when you get ot the mobile number you can call a function that creates a mobile variable and then asks for the number and the company. The function returns the address of the mobile variable it created and you put that address in the mobile pointer inside the user struct variable.
Aug 29 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.