how to copy data into array or memory ?

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2006
Posts: 4
Reputation: bh_hensem is an unknown quantity at this point 
Solved Threads: 0
bh_hensem bh_hensem is offline Offline
Newbie Poster

how to copy data into array or memory ?

 
1
  #1
Sep 4th, 2006
Hi,

Actually my program will be read some input, as example :-
123
456
789
123
567
456

Then, I want to copy all the data into array and filter out any duplicate or same record..Finally the program will be print the result without duplicate records ?

Could somebody guide me how to solved this ?
Last edited by bh_hensem; Sep 4th, 2006 at 5:46 am. Reason: better figures...
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: how to copy data into array or memory ?

 
1
  #2
Sep 4th, 2006
Originally Posted by bh_hensem View Post
Hi,

Actually my program will be read some input, as example :-
123=saya
456=ada
132=buku
321=cerita

So, I would like to copy all the data into array or whatever and print it at the end of my program. Could some body help me ?
Don't understand. The user must enter numbers or chars? Both? To copy chars to buffer you can use for example memcopy or better memmove
If you want to win, you must not loose (Alan Ford)
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 4
Reputation: bh_hensem is an unknown quantity at this point 
Solved Threads: 0
bh_hensem bh_hensem is offline Offline
Newbie Poster

Re: how to copy data into array or memory ?

 
1
  #3
Sep 4th, 2006
Oh sorry...

Users must enter both (number & char)..
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: how to copy data into array or memory ?

 
1
  #4
Sep 4th, 2006
Ok you can use those library functions which I mentioned (include string.h). But you shold post your code for more asistance, becouse forum members can't understand clearly what problem you dealing with and what programming language you use.
[edit] OK I see you edited your post now its more clearly but anyway post your code[/edit]
Last edited by andor; Sep 4th, 2006 at 5:51 am.
If you want to win, you must not loose (Alan Ford)
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: how to copy data into array or memory ?

 
1
  #5
Sep 4th, 2006
So how much have you managed yourself?
- reading a line in
- separating the number and the word
- storing them in an array
?

Post what you can achieve, then the answer will be more likely tuned to your specific needs.

It also shows you've done some work and not just dumped your assignment on a message board.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC