Click here to Skip to main content
15,914,780 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questionnanosecond Pin
mehmetned24-Jul-06 22:20
mehmetned24-Jul-06 22:20 
AnswerRe: nanosecond Pin
mehmetned24-Jul-06 22:33
mehmetned24-Jul-06 22:33 
GeneralRe: nanosecond Pin
Bob X25-Jul-06 5:19
Bob X25-Jul-06 5:19 
GeneralRe: nanosecond [modified] Pin
Jonathan [Darka]25-Jul-06 22:52
professionalJonathan [Darka]25-Jul-06 22:52 
AnswerRe: nanosecond Pin
Jeremy Thornton27-Jul-06 2:16
Jeremy Thornton27-Jul-06 2:16 
QuestionUnable to run C programs in C++ Pin
Mohit Namdeo24-Jul-06 8:57
Mohit Namdeo24-Jul-06 8:57 
AnswerRe: Unable to run C programs in C++ Pin
Anna-Jayne Metcalfe26-Jul-06 6:11
Anna-Jayne Metcalfe26-Jul-06 6:11 
QuestionTo remove errors from followng code of doubly linked list. Pin
arun.m24-Jul-06 7:37
arun.m24-Jul-06 7:37 
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
#include
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 {
printf("enter the element%d\t",i+1);
scanf("%d",&m);
create(m)
{
break;
case 2:printf("enter the element\t");
scanf("%d",&m);
add at beg (m);
break;
case 3:printf("enter the element\t");
scanf("%d",&m);
printf("enter the position after which element\t");
scanf("%d",&po);
add_after (m,po);
break;
case 4:printf("enter the element for deletion\t");
scanf("%d",&m);
break;
case 5:display(); break;
case 6:count(); break;
case 7:rev(); break;
case 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 {
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



arun

Questionlaunching a program without black DOS box Pin
kahkaha22-Jul-06 7:37
kahkaha22-Jul-06 7:37 
AnswerRe: launching a program without black DOS box Pin
nainto23-Jul-06 3:49
nainto23-Jul-06 3:49 
QuestionPolymorphic operator overloads Pin
Mathpurist21-Jul-06 10:42
Mathpurist21-Jul-06 10:42 
QuestionDebugging assemblies Pin
kevinFields21-Jul-06 6:16
kevinFields21-Jul-06 6:16 
AnswerRe: Debugging assemblies Pin
Jonathan [Darka]25-Jul-06 23:06
professionalJonathan [Darka]25-Jul-06 23:06 
QuestionHelp Regarding "Reading from files" Pin
prgr21-Jul-06 4:55
prgr21-Jul-06 4:55 
QuestionWhat is AxMSComm and how we use it Pin
mertadin21-Jul-06 3:08
mertadin21-Jul-06 3:08 
AnswerRe: What is AxMSComm and how we use it Pin
nainto23-Jul-06 3:54
nainto23-Jul-06 3:54 
GeneralRe: What is AxMSComm and how we use it Pin
mertadin23-Jul-06 22:36
mertadin23-Jul-06 22:36 
QuestionHelp needed: another strange calloc/malloc issue Pin
lyuabe20-Jul-06 23:29
lyuabe20-Jul-06 23:29 
AnswerRe: Help needed: another strange calloc/malloc issue Pin
toxcct21-Jul-06 0:21
toxcct21-Jul-06 0:21 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 0:25
lyuabe21-Jul-06 0:25 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
toxcct21-Jul-06 0:26
toxcct21-Jul-06 0:26 
QuestionCasting problem (String* to LPCVOID) Pin
stancrm20-Jul-06 3:29
stancrm20-Jul-06 3:29 
AnswerRe: Casting problem (String* to LPCVOID) Pin
toxcct20-Jul-06 3:32
toxcct20-Jul-06 3:32 
AnswerRe: Casting problem (String* to LPCVOID) Pin
NrmMyth20-Jul-06 3:33
NrmMyth20-Jul-06 3:33 
AnswerRe: Casting problem (String* to LPCVOID) Pin
Michael Dunn20-Jul-06 5:58
sitebuilderMichael Dunn20-Jul-06 5:58 

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.