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!

    I NEED TO USE POINTERS TO ADD EDIT AND VIEW , I'M NOT YET DONE TO THIS CODING.. please help me !

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    > i think my coding is very complicated
    How is that complicated? It's just a huge list of repeated code with hard-coded values and outdated API functions. Scrap the clrscr(), scrap the getch(), and definitely scrap the gotoxy() with hard-coded numbers.

    > or please post any coding that can make add edit view database on turbo c
    Don't use Turbo C, don't use void main, and don't expect us to give you free source code. If you're interested in getting a full-fledged program, you should be hiring people, not expecting good will on a forum.

    > i really dont get the exact explanation of pointers , please help me!
    If you're so lazy you won't try to understand WHY what you do works, and how to adapt it to other situations, you don't deserve our help, let alone free source code. From your code, you seem to have no understanding of pointers, and shoving random values into random pointers (and not even correctly).


    EDIT: give these articles a read, and don't post back until you have
    > SourceForge.net: Turbo C - cpwiki
    > SourceForge.net: Void main - cpwiki
    > SourceForge.net: Indentation - cpwiki

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Add,Edit,View[help] database turbo c
    By amhiine24 in forum C++ Programming
    Replies: 3
    Last Post: 02-10-2012, 08:24 AM
  2. add,view=ok, search,edit got error... help!
    By private0430 in forum C Programming
    Replies: 4
    Last Post: 09-27-2009, 01:36 PM
  3. Replies: 6
    Last Post: 07-07-2008, 07:48 AM
  4. Validate Tree View Label Edit?
    By SMurf in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2006, 08:23 PM
  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