473,786 Members | 2,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

telephone pointer program

91 New Member
This isn't a homework,i want to improve my skills in programming and apply my understanding to pinters. i'm developing a program that will print telephone numbers randomly for a city for instance(maybe use a code for (011) and those telephone numbers should be equal to 10 numbers. so may someone please give a clue how to start this beautiful thinking of mine.thanks
Sep 17 '07 #1
10 2461
Nkhosinathie
91 New Member
This isn't a homework,i want to improve my skills in programming and apply my understanding to pinters. i'm developing a program that will print telephone numbers randomly for a city for instance(maybe use a code for (011) and those telephone numbers should be equal to 10 numbers. so may someone please give a clue how to start this beautiful thinking of mine.thanks
i'm still doing reseach for this program,i just ask any ideas will help
Sep 17 '07 #2
Savage
1,764 Recognized Expert Top Contributor
This isn't a homework,i want to improve my skills in programming and apply my understanding to pinters. i'm developing a program that will print telephone numbers randomly for a city for instance(maybe use a code for (011) and those telephone numbers should be equal to 10 numbers. so may someone please give a clue how to start this beautiful thinking of mine.thanks
Are you using c++ ?

Savage
Sep 17 '07 #3
Nkhosinathie
91 New Member
Are you using c++ ?

Savage
yes sir i'm doing this research program using a c++ language
Sep 17 '07 #4
sicarie
4,677 Recognized Expert Moderator Specialist
yes sir i'm doing this research program using a c++ language
Seems like you'll need to decide how you are going to store the numbers (the format), and how they will be stored (with other numbers) in a collection. (Maybe the STL can help you there?)
Sep 17 '07 #5
Nkhosinathie
91 New Member
Seems like you'll need to decide how you are going to store the numbers (the format), and how they will be stored (with other numbers) in a collection. (Maybe the STL can help you there?)
the problem is we arev still doing pointers so we haven't reached the data structures yet so my program should include only arrays and pointers
Sep 18 '07 #6
Savage
1,764 Recognized Expert Top Contributor
the problem is we are still doing pointers so we haven't reached the data structures yet so my program should include only arrays and pointers
OK,it will be a little bit more complicated then.

You said that telephone number should have 10 digits,right?

If you are familiar with functions,you could create one that will read telephone number from a istream,and add it to your's big array of telephone numbers.

Savage
Sep 18 '07 #7
Nkhosinathie
91 New Member
OK,it will be a little bit more complicated then.

You said that telephone number should have 10 digits,right?

If you are familiar with functions,you could create one that will read telephone number from a istream,and add it to your's big array of telephone numbers.

Savage
thanks sir for the help,but may i ask? what if i want my program also to generate those phone numbers randomly?
Sep 18 '07 #8
Savage
1,764 Recognized Expert Top Contributor
thanks sir for the help,but may i ask? what if i want my program also to generate those phone numbers randomly?
Please stop calling me sir.I feel uncomfortable.W e all here study and/or work for living.

Now to the problem:

You can also write a simple function.To lower the space needed and compatibility whit char arrays,you can randomly generate 10 chars(chars can range from -127 to 128 and you need only a single digit ranging from 0-9) and merge them into single string which you will then return.Do you know how to generate random numbers?

Savage
Sep 18 '07 #9
Nkhosinathie
91 New Member
Please stop calling me sir.I feel uncomfortable.W e all here study and/or work for living.

Now to the problem:

You can also write a simple function.To lower the space needed and compatibility whit char arrays,you can randomly generate 10 chars(chars can range from -127 to 128 and you need only a single digit ranging from 0-9) and merge them into single string which you will then return.Do you know how to generate random numbers?

Savage
i know how to generate numbers i can use function srand(time(0)) to generate those numbers,but now i'm confused about the simple function you suggested to lower the space,may you give me an example of it.and i've already started with the program i'll show you shortly what i've done so far and i apologise for callin you sir
Sep 18 '07 #10

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

Similar topics

0
1404
by: Cesare Nicolai C. | last post by:
Hi! Someone knows if using only MIDP1.0 to program an application, these last works on all the cellular ones that support such profile? Moreover the same application can wark on a telephone gprs and umts or can arise problems (for example connected to the band.)? Thanks, Cesar
383
12258
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a poor man's DBMS, a broken email server and various other /application/ servers to try and crack the Internet and IS markets. In the case where they didn't spend their own money to get companies to
110
9965
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object must be an object instead of
4
7540
by: Iftikhar Hussain | last post by:
Hello Everyone Nice to be back here, well all u guys have helped in past & now I would like a favor again. first what i want to develop is as follows: An application for rescue station, where there is a Telephone & a Computer System . the telephone is also connected with the computer system, so when the telphone rings, the Computer can act as a CLI & could identify, which number the call is coming from. it gets that number, matches it...
1
1917
by: Nick Bishop | last post by:
I have a problem where I call a method in a C++ class with a pointer which is a static member in that class. When I use a debugger, I see the pointer having a certain value, but when I step into the method (F11), the pointer has a different value and is not pointing at anything valid. The small program (complete source below) demonstrates what I am trying to achieve. The small program works perfectly, but when I incorporate this logic...
1
5628
by: SteadyEddie | last post by:
I have to write a program to calculate a telephone bill, which converts hours into minutes (done), show the day of the week in full from a single letter input (done) calculate the cost of the call (this is were I am stuck). The first 3 minutes are charged at 1.50 and any minutes after that are charged at 0.30 per min. The calculation that I have tried reads as follows: //This Section Calculates The Cost Of The Call. void CallCost() {...
5
8023
by: yenra | last post by:
Can anyone help me in making this program?!... I need to make a telephone directory using structure definition.. typedef struct AddressTag{ char surname; char givenname; char middleinitial; char telnum; struct PersonTag *next;
1
2251
by: silent15 | last post by:
I am having a bit of trouble writing a function for a telephone directory. I need to create a program that upon prompt of first and last name it needs to output the corresponding number from a dat file or indicates that the name isnt in the file. then after each lookup i need to ask whether to look up another number or exit. this is the code I have so far, I am not very good with functions so... #include <iostream> #include <string>...
0
2865
by: tlontz | last post by:
I am trying to retrieve the telephone_number from active directory using the following script: Dim search As New DirectorySearcher("") search.Filter = "(&(objectCategory=Person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(samaccountname=" + UserName.ToString.Trim + "))" 'search.Filter = "(&(!(userAccountControl:1.2.840.113556.1.4.803:=2))( objectCategory=person)(samaccountname=" +...
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.