Thread: gotoxy() or something for fprintf()

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    gotoxy() or something for fprintf()

    for(x=1;x<=num;x++)
    {
    gotoxy(1,y);
    scanf ("%s",&player[x].rank);
    fprintf(f," %s",player[x].rank);

    gotoxy(8,y);
    scanf("%s",&player[x].name);
    fprintf(f,"%s ",player[x].name);

    gotoxy(26,y);
    scanf ("%s",&player[x].region);
    fprintf(f,"%s",player[x].region);

    gotoxy(39,y);
    scanf("%s",&player[x].totalp);
    fprintf(f,"%s",player[x].totalp);

    gotoxy(54,y);
    scanf ("%s",&player[x].tourn);
    fprintf(f,"%s",player[x].tourn);

    gotoxy(66,y);
    scanf ("%s",&player[x].rankp);
    fprintf(f,"%s",player[x].rankp);
    y++;
    }
    ---------------------------------------------------------
    Look at the above code, can anyone tell me how to position the fprintf info in my text file just like the scanf()'s in the program?

  2. #2
    Registered User penney's Avatar
    Join Date
    Jan 2003
    Posts
    47
    I believe for what you are trying to do, you should create a structure and save the coordinates to it and then save the structure out to the file.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Question

    I don't know how create a structure, can you give an example with explinations or a site that can help me?
    Last edited by Beginnerinc; 02-18-2003 at 04:08 PM.

  4. #4
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    here's a website I found that will teach you about data structures, and a lot more too. It's the fifth result in a google search for C data structures. It's not that hard to do, so you could do it yourself

    http://ciips.ee.uwa.edu.au/~morris/Y...10/ds_ToC.html

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Lightbulb

    Thanks alot for the advices all..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe movement
    By $l4xklynx in forum Game Programming
    Replies: 4
    Last Post: 11-06-2008, 07:22 PM
  2. Why do I need function for gotoxy and not getche?
    By Beholder in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2005, 03:19 PM
  3. Want to see if I am using gotoxy the right way ...
    By o0obruceleeo0o in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2003, 04:17 PM
  4. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 02:48 PM
  5. is gotoxy a part of ANSI C 89 standard
    By kendals in forum C Programming
    Replies: 1
    Last Post: 03-20-2002, 07:43 PM