Thread: Add,Edit,View[help] database turbo c

  1. #1
    Registered User
    Join Date
    Sep 2011
    Location
    Muntinlupa City
    Posts
    15

    Add,Edit,View[help] database turbo c

    hello ! someone help me for this coding ,
    Code:
    #include<stdio.h>
    #include<conio.h>
    #include<string.h>
    #include<stdlib.h>
    void main()
    {
    	int choice,age,*age_ptr,age1;
    	char name,*name_ptr,add,*add_ptr,name1,add1;
    	clrscr();
    	do{
    
    	gotoxy(32,10);
    	printf("WELCOME !");
    	gotoxy(24,12);
    	printf("Press 'ENTER' to continue...");
    	getchar();
    	clrscr();
    	gotoxy(8,4);
    	printf("[1] Add");
    	gotoxy(8,6);
    	printf("[2] Edit");
    	gotoxy(8,8);
    	printf("[3] View");
    	gotoxy(8,10);
    	printf("[4] Exit");
    	gotoxy(8,12);
    	printf("[!] Your choice:");
    	gotoxy(24,12);scanf("%d",&choice);
    	if(choice==1){
    	clrscr();
    	gotoxy(8,4);
    	printf("[1] Add");
    	gotoxy(8,6);
    	printf("Name:");
    	gotoxy(8,8);
    	printf("Age:");
    	gotoxy(8,10);
    	printf("Address:");
    	gotoxy(15,6);scanf("%s",&name);
    	gotoxy(15,8);scanf("%d",&age);
    	gotoxy(16,10);scanf("%s",&add);
    	name_ptr=&name;
    	age_ptr=&age;
    	add_ptr=&add;
    	}
    	if(choice==2){
    	clrscr();
    	gotoxy(8,4);
    	printf("[2] Edit");
    	gotoxy(8,6);
    	printf("Maintenance");
    	}
    	if(choice==3){
    
    
    	clrscr();
    	gotoxy(8,4);
    	printf("[3] View");
    	gotoxy(8,6);
    	printf("Name:");
    	gotoxy(8,8);
    	printf("Age:");
    	gotoxy(8,10);
    	printf("Address:");
    	name1=*name_ptr;
    	gotoxy(15,6);printf("%s",name1);
    	age1=*age_ptr;
    	gotoxy(15,8);printf("%d",age1);
    	add1=*add_ptr;
    	gotoxy(15,10);printf("%s",add1);
    	}
    	if(choice==4){
    	clrscr();
    	gotoxy(8,4);
    	printf("[4] Exit");
    	gotoxy(8,6);
    	printf("Bye!");
    	}
    	}while(choice!=4);
    	getch();
    	}
    i think my coding is very complicated, or please post any coding that can make add edit view database on turbo c , i really dont get the exact explanation of pointers , please help me!

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Drop "Turbo C". Seriously, I don't know who is feeding you guys this crap, but anyone starting programming between India and Japan is using this antiquity. That thing was created when computers were slower than my current phone. Whoever taught you to use it is probably in his 60s. You are lucky you weren't taught punch cards.

    Code::Blocks is good and free. Microsoft Visual Studio Express is good and free. There are others around. Use a compiler from this millenium. Please.

    As for pointers: you don't need any here. Concentrate on the useful things:

    Code:
    #include<stdio.h>
    
    int main()
    {
    	char name[100];
    	
        printf("Enter your name:");
    	scanf("%s", name );
    	printf("\nThe name you entered was %s\n", name);
    	    
    	return 0;
    }
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    also since this is the C++ forum, you should be using iostream and cin/cout instead of stdio functions, unless you are actually using C, in which case you should have posted on the C forum, because C is a very different language from C++.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. add,view=ok, search,edit got error... help!
    By private0430 in forum C Programming
    Replies: 4
    Last Post: 09-27-2009, 01:36 PM
  2. Replies: 6
    Last Post: 07-07-2008, 07:48 AM
  3. Validate Tree View Label Edit?
    By SMurf in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2006, 08:23 PM
  4. Database app - cannot edit fields
    By geek@02 in forum Windows Programming
    Replies: 0
    Last Post: 03-10-2006, 01:13 AM
  5. How to view and edit grafic vector images like EPS?
    By Fender92 in forum C Programming
    Replies: 3
    Last Post: 10-25-2001, 08:34 AM