Click here to Skip to main content
15,920,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Source code for textbox validation Pin
Ed.Poore24-Jul-06 4:07
Ed.Poore24-Jul-06 4:07 
Questiona few question about windows forms ??? Pin
cmpeng3424-Jul-06 1:35
cmpeng3424-Jul-06 1:35 
AnswerRe: a few question about windows forms ??? Pin
Ed.Poore24-Jul-06 1:41
Ed.Poore24-Jul-06 1:41 
QuestionI need Run Movie On Tv Using Video card Pin
shakil ahmed24-Jul-06 1:16
shakil ahmed24-Jul-06 1:16 
AnswerRe: I need Run Movie On Tv Using Video card Pin
Gavin Roberts24-Jul-06 5:58
Gavin Roberts24-Jul-06 5:58 
Question.Net framework v 1.1 doubt. Pin
alimohammed24-Jul-06 1:08
alimohammed24-Jul-06 1:08 
AnswerRe: .Net framework v 1.1 doubt. Pin
WillemM24-Jul-06 2:17
WillemM24-Jul-06 2:17 
QuestionTo remove errors from followng code of doubly linked list. Pin
arun.m24-Jul-06 0:20
arun.m24-Jul-06 0:20 
HI,
I have written followng linked program using doubly linked list and the errors are:
1-> code has no effect.
2-> unreachable code.
3-> statement missing.

and the code is are as follow

#include<stdio.h>
#include<alloc.h>
create(int);
add_atbeg (int);
add_after (int ,int);
del();
display();
count();
rev();
struct node
{
struct node *left;
int data;
int *tmp;
struct node *right;
}*start;
main()
{
int ch,n,m,po,i;
start=NULL;
printf("\n1 :create list");
printf("\n2:add at begining");
printf("\n3:add after");
printf("\n4:delete");
printf("\n5:display");
printf("\n6:count");
printf("\n7:reverse");
printf("\n8:quit");

while(1)
{
printf("enter choice\t");
scanf("%d",&ch);
switch(ch)
{
case 1:printf("how many nodes you want\t");
scanf("%d",&n);
for(i=0;i<n;i++)
{
="" printf("enter="" the="" element%d\t",i+1);
="" scanf("%d",&m);
="" create(m)
="" break;
="" case="" 2:printf("enter="" element\t");
="" add="" at="" beg="" (m);
="" 3:printf("enter="" position="" after="" which="" scanf("%d",&po);
="" add_after="" (m,po);
="" 4:printf("enter="" element="" for="" deletion\t");
="" 5:display();="" 6:count();="" 7:rev();="" 8:exit();
="" default="" :printf("wrong="" choice");
="" }
="" }

="" create(int="" num)
="" struct="" node="" *q,*tmp;
="" tmp="malloc(size" of(struct="" node));
="" tmp-="">data=NULL;
tmp->right=NULL;
if(start==NULL)
{
tmp->=NULL;
start->right=tmp;
start=tmp;
}
else
{
q=start;
while(q->right!=NULL)
q=q->right;
q=right=tmp;
tmp->left=q;
}
add_beg (int num)
{
struct node *tmp;
tmp=malloc(size of(struct node));
tmp->=NULL;
tmp->data=num;
tmp->right=start;
start->left=tmp;
start=tmp;
}
add_after(int num,int c)
{
struct node *tmp,*q;
int i;
q=start;
for(i=0;i<c-1;i++)
{
="" q="q-">right;
if (q==NULL)
{
printf("therre are less than %d elements\n");
return;
}
}
tmp=malloc(size of(struct node));
tmp->data=num;
q->right->left=tmp;
tmp->right=q=right;
tmp->left=q;
q->right=tmp;
}
del(int num)
{
struct node *tmp,*q;
if(start->data==num)
{
tmp=start;
start=start->right;
start->left=NULL;
free(tmp);
return;
}
q=start;
while(q->right->data==num)
{
tmp=q->right;
q->right=tmp->right;
tmp->right->left=q;
free(tmp);
return;
}
q=q->right;
}
if(q->right->data==num)
tmp=q->right;
free(tmp);
q->right=NULL;
return;
}
printf("element %d not found\n",num);
}
display()
{
struct node *q;
if(start==NULL)
{
printf("list is empty\n");
return;
}
q=start;
printf("list is\n\n");
while(q!=NULL)
{
printf("%d",1->data);
q=q->right;
}
printf("\n");
}
count()
{
struct node *q=start;
int cnt=0;
while(q!=NULL)
{
q=q->right;
cnt++;
}
printf("number of elements are %d\n",cnt);
}
rev()
{
struct node *p1,p2;
p1=start;
p2=p1->right;
p1->=NULL;
p1->left=p2;
while(p2!=NULL)
{
p2->left=p2->right;
p2->right=p1;
p1=p2;
p2=p2->right;
}
start=p1;
}
}}

arun

AnswerRe: To remove errors from followng code of doubly linked list. Pin
stancrm24-Jul-06 0:34
stancrm24-Jul-06 0:34 
QuestionNew to C# Pin
vikas amin24-Jul-06 0:03
vikas amin24-Jul-06 0:03 
AnswerRe: New to C# Pin
Ed.Poore24-Jul-06 0:08
Ed.Poore24-Jul-06 0:08 
GeneralRe: New to C# Pin
engsrini24-Jul-06 0:21
engsrini24-Jul-06 0:21 
AnswerRe: New to C# Pin
Drew McGhie24-Jul-06 3:35
Drew McGhie24-Jul-06 3:35 
Questionaudio and video compression Pin
duaaali23-Jul-06 23:50
duaaali23-Jul-06 23:50 
AnswerRe: audio and video compression Pin
Ed.Poore24-Jul-06 0:10
Ed.Poore24-Jul-06 0:10 
QuestionIt about OnPaint Event Pin
amitjul23-Jul-06 23:31
amitjul23-Jul-06 23:31 
AnswerRe: It about OnPaint Event Pin
stancrm24-Jul-06 0:32
stancrm24-Jul-06 0:32 
Questionemail using MIME. Please help. Pin
alimohammed23-Jul-06 22:57
alimohammed23-Jul-06 22:57 
AnswerRe: email using MIME. Please help. Pin
Guffa23-Jul-06 23:26
Guffa23-Jul-06 23:26 
QuestionRe: email using MIME. Please help. Pin
alimohammed23-Jul-06 23:29
alimohammed23-Jul-06 23:29 
AnswerRe: email using MIME. Please help. Pin
Guffa24-Jul-06 2:35
Guffa24-Jul-06 2:35 
GeneralRe: email using MIME. Please help. Pin
alimohammed24-Jul-06 2:42
alimohammed24-Jul-06 2:42 
GeneralRe: email using MIME. Please help. Pin
Gavin Roberts24-Jul-06 6:01
Gavin Roberts24-Jul-06 6:01 
QuestionHow to create a intelliscence editor Pin
sarojkumarjena23-Jul-06 22:30
sarojkumarjena23-Jul-06 22:30 
AnswerRe: How to create a intelliscence editor Pin
Nader Elshehabi23-Jul-06 23:00
Nader Elshehabi23-Jul-06 23:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.