User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 391,944 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,901 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 12901 | Replies: 49
Reply
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 11
Solved Threads: 101
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: deleting duplicates in array

  #11  
Oct 29th, 2004
Originally Posted by galmca
i have been online here for 2 hrs..almost and didn't get any reply from any1/../so i was checking on some other threads of this site....as im new to this site...so plz don't take it otherwise...and help me out.......plz with this problem......

2 hours?!?!? You've not gotten an answer in 2 hours, and you're complaining?!?!?

Come on now. We're doing this for free-- you have no right to complain even if we don't answer in 2 days! Please be more mindful in the future. If nobody answers your question promptly, it's likely because we don't have the answer, or the right person has not yet visited the site.

Please be more considerate of other forum members, and don't bump your post in the same day you posted.
Alex Cavnar, aka alc6379
Reply With Quote  
Join Date: Sep 2004
Posts: 6,018
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 26
Solved Threads: 414
Super Moderator
Narue's Avatar
Narue Narue is online now Online
Expert Meanie

Re: deleting duplicates in array

  #12  
Oct 29th, 2004
>it's likely because we don't have the answer, or the right person has not yet visited the site.
Or the first person who wanted to help was too insulted and deleted the meat of her post. Anyway, it's best to just ignore people like galmca. They go away after a short time and leave us in peace.
Member of: Beautiful Code Club.
Reply With Quote  
Join Date: Jun 2004
Location: Marin, CA, USA
Posts: 434
Reputation: Chainsaw is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 10
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: deleting duplicates in array

  #13  
Oct 29th, 2004
Well, galmca has legitemate questions and supplies some sample code, so s/he just needs to learn a little etiquate. That's better than the people who type in the question the professor posed and wants us to do their homework.
Reply With Quote  
Join Date: Apr 2004
Posts: 3,449
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: deleting duplicates in array

  #14  
Oct 29th, 2004
 #include <stdio.h>
 int main(){int*i,*j,a[]={10,20,30,40,30};for(i=a;i<&a[sizeof a/sizeof*a];++i){for(j=a;j<i;++j){if(*i==*j){break;}}if(i==j){printf(&",%d"[i==a],*i);}}putchar('\n');return 0;}
 
Reply With Quote  
Join Date: Dec 2003
Location: Nashville, TN
Posts: 2,333
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Rep Power: 11
Solved Threads: 101
Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: deleting duplicates in array

  #15  
Oct 30th, 2004
Originally Posted by Chainsaw
Well, galmca has legitemate questions and supplies some sample code, so s/he just needs to learn a little etiquate. That's better than the people who type in the question the professor posed and wants us to do their homework.

Very true, but I think according to Narue, there's a trend possibly forming...
Alex Cavnar, aka alc6379
Reply With Quote  
Join Date: Sep 2004
Posts: 6,018
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 26
Solved Threads: 414
Super Moderator
Narue's Avatar
Narue Narue is online now Online
Expert Meanie

Re: deleting duplicates in array

  #16  
Oct 30th, 2004
Originally Posted by Dave Sinkula
 #include <stdio.h>
 int main(){int*i,*j,a[]={10,20,30,40,30};for(i=a;i<&a[sizeof a/sizeof*a];++i){for(j=a;j<i;++j){if(*i==*j){break;}}if(i==j){printf(&",%d"[i==a],*i);}}putchar('\n');return 0;}
 
What, no recursion?
#include<stdio.h>
#include<stdlib.h>
a[20]={0};i=0;n=20;d(j)int(j);{j<n?printf("%-3i",
j++[a]),d(j):putchar('\n');}e(j)int(j);{j<20?j++[
a]=rand()%10,e(j):d(0);}f(j){j<n-1?j[a]=a[j+1],f(
j+1):--n;}g(i,v)int(i),v;{return(i>=n?i:i[a]==v?f
(i),g(i,v),i:g(i+1,v),i);}main(){!i?e(0):i==n?d(0
):0;return(i!=n?(i=g(i+1,i[a])),main():0);}
:mrgreen:
Member of: Beautiful Code Club.
Reply With Quote  
Join Date: Oct 2004
Posts: 47
Reputation: galmca is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
galmca galmca is offline Offline
Light Poster

Re: deleting duplicates in array

  #17  
Oct 30th, 2004
im really sorry but i didn't get the code which has been provided to me...it seems really complex when i read that....so could u plz help me out in the terms of the way i wrote....that way i'll be able to understand better...like to find out the duplicate element in an array...
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
if(a[i]==a[j])
printf("duplicate exists");
else
printf("duplicate does not exists");
}
}
Reply With Quote  
Join Date: Oct 2004
Posts: 47
Reputation: galmca is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
galmca galmca is offline Offline
Light Poster

Re: deleting duplicates in array

  #18  
Oct 30th, 2004
is that way wrong?
Reply With Quote  
Join Date: Oct 2004
Location: Lebanon OR, 97355
Posts: 67
Reputation: N3wbi3C0d3r is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
N3wbi3C0d3r's Avatar
N3wbi3C0d3r N3wbi3C0d3r is offline Offline
Junior Poster in Training

Re: deleting duplicates in array

  #19  
Oct 30th, 2004
I think on my part, Narue is a smart person, but does have a short fuse for newbies, i was new, but i found fast how to fit in better, read some other post's, to figure out how things go, some people arn't like me and go to the extent to fit in. galmca does have a good question, since ima newbie, and just learned the loops and what not, idont know how to helpm, Narue, you'r smart, but atleast don't be so rude about it, and yes galmca, i have 2 post'sd that have been here for days and, no answer, so i took matters into my own hands, and did it myself. They arn't paid, so sometimes, do it yourself has to be sufficient..
Reply With Quote  
Join Date: Oct 2004
Location: Lebanon OR, 97355
Posts: 67
Reputation: N3wbi3C0d3r is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
N3wbi3C0d3r's Avatar
N3wbi3C0d3r N3wbi3C0d3r is offline Offline
Junior Poster in Training

Re: deleting duplicates in array

  #20  
Oct 30th, 2004
That code there sounds about correct to me galmca, of course from above post, im new, and don;t know, but i just finished reading that section ;P
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C Marketplace
Thread Tools Display Modes

Other Threads in the C Forum

All times are GMT -4. The time now is 8:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC