•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 455,985 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,759 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: Programming Forums
Views: 571 | Replies: 8
![]() |
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
i am new at programming basic.. i got this problem at school... i want to seek help from you!..its all about inserting and deleting arrays in c language!.. im really confused about the code of this...pls help me!...
for example:
given this output:
Menu Operations:
[1]Insert at beginning
[2]Insert at middle
[3]Insert at End
[4]Show array elements
[5]Delete array elements
[6]Exit
Enter element u want to insert:_ //first u need to enter a first value
Enter your choice of operation?:_ //what operaton you will used..
Enter element u want to insert: _ //need to enter another value
Enter your choice of operation: _ //operation again..
Enter element u want to insert: _ //need to enter another value
Enter your choice of operation: _ //operation again..
//the Output would display the arrays showing every operation you made
eg...
//you enter a value of 1 in the first element and the second is 2 and the third is 3...
//when u choose operation #3 the output would be...
1 2 3
//and so on the other operations....pls help me!... i really need your help!
//thanks!...
for example:
given this output:
Menu Operations:
[1]Insert at beginning
[2]Insert at middle
[3]Insert at End
[4]Show array elements
[5]Delete array elements
[6]Exit
Enter element u want to insert:_ //first u need to enter a first value
Enter your choice of operation?:_ //what operaton you will used..
Enter element u want to insert: _ //need to enter another value
Enter your choice of operation: _ //operation again..
Enter element u want to insert: _ //need to enter another value
Enter your choice of operation: _ //operation again..
//the Output would display the arrays showing every operation you made
eg...
//you enter a value of 1 in the first element and the second is 2 and the third is 3...
//when u choose operation #3 the output would be...
1 2 3
//and so on the other operations....pls help me!... i really need your help!
//thanks!...
Last edited by devilofangel : Dec 4th, 2007 at 1:05 pm. Reason: lack of info
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
#include<stdio.h>
#include<conio.h>
#define MAX_LEN 100
void display (int*,int);
void main()
{
int num[MAX_LEN];
int i, input, op;
char ch;
clrscr();
printf("\tMenu");
printf("\n[1]Insert at beginning\n[2]Insert at middle\n[3]Insert at end\n[4]Show Array elements\n[5]Delete array element\n[6]Exit");
printf("\nEnter Element: " );scanf("%d",& input);
do{
printf("\nChoose Operation: ");
scanf("%d",&op);
}while(op!=5); //after this i really dont know what to do
//can someone help me with this?.. pls!
getch();
}
void display(int*arr,int index)
{
int i;
for(i=0;i<=index;i++)
{
printf("%d",arr[i]);
}
}
#include<conio.h>
#define MAX_LEN 100
void display (int*,int);
void main()
{
int num[MAX_LEN];
int i, input, op;
char ch;
clrscr();
printf("\tMenu");
printf("\n[1]Insert at beginning\n[2]Insert at middle\n[3]Insert at end\n[4]Show Array elements\n[5]Delete array element\n[6]Exit");
printf("\nEnter Element: " );scanf("%d",& input);
do{
printf("\nChoose Operation: ");
scanf("%d",&op);
}while(op!=5); //after this i really dont know what to do
//can someone help me with this?.. pls!
getch();
}
void display(int*arr,int index)
{
int i;
for(i=0;i<=index;i++)
{
printf("%d",arr[i]);
}
}
Well there's this - http://www.daniweb.com/forums/announcement118-3.html
So that people might care enough to look at your code rather than just dismissing it as an unreadable mess.
So that people might care enough to look at your code rather than just dismissing it as an unreadable mess.
•
•
Join Date: Mar 2005
Location: Phnom Penh, Cambodia
Posts: 415
Reputation:
Rep Power: 5
Solved Threads: 36
•
•
Join Date: Mar 2005
Location: Phnom Penh, Cambodia
Posts: 415
Reputation:
Rep Power: 5
Solved Threads: 36
Anyway, I have made your code clean so more people will more interesting in helping you. I am sleepy now. Good night!
cpp Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> #define MAX_LEN 100 void display (int*,int); void main() { int num[MAX_LEN]; int i, input, op; char ch; clrscr(); printf("\tMenu"); printf("\n[1]Insert at beginning\n[2]Insert at middle\n[3]Insert at end\n[4]Show Array elements\n[5]Delete array element\n[6]Exit"); printf("\nEnter Element: " ); scanf("%d", &input); do { printf("\nChoose Operation: "); scanf("%d",&op); } while(op!=5); //after this i really dont know what to do //can someone help me with this?.. pls! getch(); } void display(int*arr,int index) { int i; for(i=0;i<=index;i++) { printf("%d",arr[i]); } }
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Behind every smile is a tear.
Visal .In
•
•
Join Date: Mar 2005
Location: Phnom Penh, Cambodia
Posts: 415
Reputation:
Rep Power: 5
Solved Threads: 36
I still don't understand what are you trying to. There are 6 operators; first operator is for insert at the beginning. The beginning is refer to the first element of array. For example: firstly, I used [1] operator which insert a value into the first element of array. Then I decided to use that operator again, so I will insert a value into first element of array again? I still don't get it.
Last edited by invisal : Dec 4th, 2007 at 3:10 pm.
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Behind every smile is a tear.
Visal .In
A peice of humble advice for devilofangel
You may have not known this before but it is considered (very truelly so) a malpractice and a cheap way to increase the no. of posts to post content in multiple posts. I learned this the harder way by losing my reputation. So I thought that I must inform you.
You may have not known this before but it is considered (very truelly so) a malpractice and a cheap way to increase the no. of posts to post content in multiple posts. I learned this the harder way by losing my reputation. So I thought that I must inform you.
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.
"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- windows xp installation error!! pls help! (Troubleshooting Dead Machines)
- Help me remove Online Poker Pop up pls (Viruses, Spyware and other Nasties)
- hi friends pls help me out (C++)
- pls.help me im begging you!!! (C)
- pls... i need help!!! (C)
- Pls Hlp me with Hijackthis log file. (Viruses, Spyware and other Nasties)
- Pls help with my HJT log (Viruses, Spyware and other Nasties)
- can somebody pls. help me out with my HJT log.. (Viruses, Spyware and other Nasties)
Other Threads in the C Forum
- Previous Thread: Need Serious Help With C
- Next Thread: emergency



Linear Mode