User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 10 Feb 2003, 09:07   #1
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
My program (for a lab)

It doesn't work. At all. Complains about errors that shouldn't exist.

Anyway, here it is. If you could tell me what I've done hilariously wrong it would help.

#include <stdio.h>
#include <ctype.h>
#include <string.h>

main()
{

/* Variable Declararion */

struct info {

int age;
int heighti;
int heightft;
char fname[20];
char lname[20];

} retrieve[2];


int wrap, ctr;
int rnum;

/* Loop Input Stage */

printf("Enter the number of inputs you wish to make (0 to quit)");
gets(wrap);

/* Main Information Retrieval Stage */

for (ctr=0; ctr<=wrap; ctr++) {


printf("Enter First Name\n");
gets(retrieve[wrap].fname);
printf("Enter Last Name\n");
gets(retrieve[wrap].lname);
printf("Enter Age\n");
gets(retrieve[wrap].age);
printf("Enter Height in Feet\n");
gets(retrieve[wrap].heightft);
printf("..And Inches?\n");
gets(retrieve[wrap].heighti);

printf("\n\nYour RETRIEVAL NUMBER IS:");
puts(wrap);
}

/* Output Stage */

printf("Enter your RETRIEVAL NUMBER:");
gets(rnum);


printf("Last Name\tFirst Name\tAge\tHeight\n\n");

printf("%s\t%s\t%d\t%dft %din", retrieve[rnum].fname,
retrieve[rnum].lname, retrieve[rnum].age, retrieve[rnum].heightft,
retrieve[rnum].heighti);


return 0;

}
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 09:12   #2
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
gets(wrap); &rArr; scanf("%d", &wrap);
gets(retrieve[wrap].age); &rArr; scanf("%d", &retrieve[wrap].age);
gets(retrieve[wrap].heightft); &rArr; scanf("%d", &retrieve[wrap].heightft);
gets(retrieve[wrap].heightin); &rArr; scanf("%d", &retrieve[wrap].heightin);
gets(retrieve[wrap].weightkg); &rArr; scanf("%d", &retrieve[wrap].weightkg);
gets(retrieve[wrap].IQ); &rArr; scanf("%d", &retrieve[wrap].IQ);
puts(wrap); &rArr; printf("%d", wrap);
gets(rnum); &rArr; scanf("%d", &rnum);

Or something like that.

Integers are not strings.


Just looked to see what it's actually supposed to do...

Is it supposed to crash the computer if the user enters any number other than 0 or 1?

If not, you might want to replace wrap with ctr, inside the loop, and add some check that the user didn't type 123456789 or -2147483648.

Also, do you want the user to input one more element than he/she wants to?

for (ctr=0; ctr<=wrap; ctr++) { &rArr; for (ctr=0; ctr<wrap; ctr++) {
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->

Last edited by Cyp; 10 Feb 2003 at 09:27.
Cyp is offline   Reply With Quote
Unread 10 Feb 2003, 09:26   #3
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
Do I need ctype and string.h in there? The base of this lab was another program I wrote a year ago that used those functions, but after looking at the code, I thought I would ask.

It doesn't hurt to have it in there, even if it does nothing, right?
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 09:31   #4
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
Quote:
Originally posted by Mirai
Do I need ctype and string.h in there? The base of this lab was another program I wrote a year ago that used those functions, but after looking at the code, I thought I would ask.

It doesn't hurt to have it in there, even if it does nothing, right?
Extra header files shouldn't ever hurt. (Unless they were specifically designed to hurt. Doubt the compiler-makers have that kind of tendencies though.)

Note: Was editing the above as I found new things, don't know if you saw all of it.
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 10 Feb 2003, 09:38   #5
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
Quote:
Originally posted by Cyp
Extra header files shouldn't ever hurt. (Unless they were specifically designed to hurt. Doubt the compiler-makers have that kind of tendencies though.)

Note: Was editing the above as I found new things, don't know if you saw all of it.
I saw it, and I thank you. On the good side, it compiles without any trouble. On the bad side, it gives some seriously whacked results.

Last Name First Name Age Height

ïwDïw -276903676 -277045620ft -277045620

Any idea what;s going on here?

I'm using GCC to compile the program, if that's of any help.
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 10:12   #6
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
Quote:
Originally posted by Mirai
I saw it, and I thank you. On the good side, it compiles without any trouble. On the bad side, it gives some seriously whacked results.

Last Name First Name Age Height

ïwDïw -276903676 -277045620ft -277045620

Any idea what;s going on here?

I'm using GCC to compile the program, if that's of any help.
In dos, if one input doesn't have the right type (user types "ten" instead of "10"), then all future inputs go completely insane (no idea why, writing my own input routines helps). Don't know if that's relevant without seeing the current version of code.

Don't know about Linux/GCC.
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 10 Feb 2003, 10:50   #7
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
scanf sucks, use fgets then sscanf to read in an int.

char input[100]; int age;
printf("Enter your age:\t");
fgets(input, sizeof(input), stdin);
sscanf(input, "%d", &age);

should work.
Nodrog is offline   Reply With Quote
Unread 10 Feb 2003, 11:07   #8
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
the first scanf statement doesn't seem to work (that's the first name scanf).. The program compiles fine, but no matter how many times I run it, the prog always skips the first statement and goes straight on to the second. It's as if it doesn't exist or something. It will still print out the question, but won't stop the program for input.

Anyone know what's up?
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 11:44   #9
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by Mirai
the first scanf statement doesn't seem to work (that's the first name scanf).. The program compiles fine, but no matter how many times I run it, the prog always skips the first statement and goes straight on to the second. It's as if it doesn't exist or something. It will still print out the question, but won't stop the program for input.

Anyone know what's up?
As I said, scanf sucks and you shouldnt use it. Use what I posted above.

If youre determined to use scanf, try scanf("\n%d", &x); instead and see if that fixes it.
Nodrog is offline   Reply With Quote
Unread 10 Feb 2003, 12:19   #10
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
Okay, well, I removed the retrieval number part of the program (it wasn't necessary and was annoying anyway) and just went directly for a listing scheme.

Problems arose..

It seems to be complaining about how a variable doesn't exist - retrieve. However, it is declared as an alias for the structure info.

I need it to be an array or else I have to reprogram pretty much the entire thing. My book is of little help in this scenario..
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 12:52   #11
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
The following code works, if you need anything explained just ask.

Code:
#include <stdio.h>

struct info {
	int age;
	int heighti;
	int heightft;
	char fname[20];
	char lname[20];
};

typedef struct info INFO;


int main() {
	INFO *people;
	int i, total;
	char input[100];

	printf("Enter number of inputs (0 to quit): ");
	fgets(input, sizeof(input), stdin);
	sscanf(input, "%d", &total);
 	if (!total) {return 0;}

	people = (INFO *) malloc(sizeof(INFO)*total);

	for (i = 0 ; i != total ; i++) {
		printf("Enter First Name: ");
		fgets((people+i)->fname, sizeof((people+i)->fname), stdin);
		printf("Enter Last Name: ");
		fgets((people+i)->lname, sizeof((people+i)->lname), stdin);
		printf("Enter Age: ");
		fgets(input, sizeof(input), stdin);
		sscanf(input, "%d", &((people+i)->age));
		printf("Enter Height In Feet: ");
		fgets(input, sizeof(input), stdin);
		sscanf(input, "%d", &((people+i)->heightft));
		printf("Enter Height In Inches: ");
		fgets(input, sizeof(input), stdin);
		sscanf(input, "%d", &((people+i)->heighti));
		printf("\n\nYour RETRIEVAL NUMBER IS: %d\n\n", i);
	}

	printf("Enter your RETRIEVAL NUMBER: ");
	fgets(input, sizeof(input), stdin);
	sscanf(input, "%d", &i);
	printf("\n\nLast Name\tFirst Name\tAge\tHeight\n\n");
	printf("%s\t%s\t%d\t%dft %din", (people+i)->fname, (people+i)->lname, (people+i)->age, (people+i)->heightft, (people+i)->heighti);
	return 0;
}
Nodrog is offline   Reply With Quote
Unread 10 Feb 2003, 13:04   #12
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
Well, as happy as I'd like to be to use your code, I can't.

You programmed that in c++. My class is on C. This may clear up some misconceptions.
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 13:29   #13
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
scanf functions have allways worked fine for me, and they're good for getting formatted input (eg. integers).
eg.
Code:
#include <stdlib.h>
#include <stdio.h>

main()
{
   int i;

   printf("Input an integer: ");
   if (fscanf(stdin, "%d", &i))
      printf("The integer read was: %i\n", i);
   else
      fprintf(stderr, "Error reading an integer from stdin.\n");
   }
}
The above compiles and runs in my copy of Borland C++ (yes i know, but this is C code as far as I can remember).

And Cyp, wierd things happen in linux with input too.
If you use cin and give it the wrong type of input (a string when it's expecting to go to an int for example) I find it tends to go nuts. The last time I 'tried' it, the result was the program got stuck in an infinate loop of input (god knows where it was getting it from) and eventually quit with a segmentation fault when it ran out of memory.

__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Unread 10 Feb 2003, 13:34   #14
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
Well, it's 5:30 am and I'm really really tired right now. 5 hours of lab will do that to you. Unfortunately, said lab is still uncompleted, and due in approximately 19 hours.

Thank you all, you've been of great help. I'm going to sleep.
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 10 Feb 2003, 14:02   #15
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by Mirai
Well, as happy as I'd like to be to use your code, I can't.

You programmed that in c++. My class is on C. This may clear up some misconceptions.
that was pure C...
Nodrog is offline   Reply With Quote
Unread 10 Feb 2003, 18:21   #16
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
I suppose, when correcting
&nbsp; gets(retrieve[wrap].age); &rArr; scanf("%d", &retrieve[wrap].age);
, you didn't also incorrectly correct
&nbsp; gets(retrieve[wrap].fname); &rArr; scanf("%d", &retrieve[wrap].fname);
(Just checking.)

Repasting the latest version of your code should help figure out what's wrong.
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 10 Feb 2003, 21:31   #17
Mirai
Child Eating Zombie Clown
 
Join Date: Apr 2001
Posts: 1,450
Mirai is on a distinguished road
As you can see, I removed some code (like the retrieval number system) that wasn't necessary for the completion of the lab. Instead, it just lists both (or all) names in a spreadsheet type fashion. Although I see problems with that now, I also see a simple for loop can fix them. But the lab states all I need is inputs for at least 2 people.

Code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>

main() 
{

/* Variable Declararion */

struct info {

  int	  age;
  int	  heighti;
  int	  heightft;
  char	  fname[20];
  char	  lname[20];
                 } retrieve[1000];

int wrap, ctr;

/* Main Information Retrieval Stage */

for (ctr=0; ctr<1; ctr++) {
                printf("Enter First Name\n");
                gets(retrieve[ctr].fname);
                printf("Enter Last Name\n");
                gets(retrieve[ctr].lname);
                printf("Enter Age\n");
                scanf("\n%d", &retrieve[ctr].age);
                printf("Enter Height in Feet\n");
                scanf("%d", &retrieve[ctr].heightft);
                printf("..And Inches?\n");
                scanf("%d", &retrieve[ctr].heighti);
                }

/* Output Stage */

printf("Last Name\tFirst Name\tAge\tHeight\n\n");
printf("%s\t%s\t%d\t%dft %din\n", retrieve[1].fname, retrieve[1].lname, retrieve[1].age, retrieve[1].heightft, retrieve[1].heighti);
printf("%s\t%s\t%d\t%dft %din\n", retrieve[2].fname, retrieve[2].lname, retrieve[2].age, retrieve[2].heightft, retreive[2].heighti);

return 0;
}
__________________
Mirai - An Astral Being From Outer Space

Die You Bitch Minister of Insanity - "Timete Nostrum Piscem Furoris"

My fellow Americans, I'm pleased to tell you today that I've signed legislation that will outlaw Russia forever, we begin bombing in 5 minutes - President Ronald Reagan, in a radio check where he did not realize the microphone was on and the station broadcasting
Mirai is offline   Reply With Quote
Unread 11 Feb 2003, 00:50   #18
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
So you are inputting one element, elements 0 to 0, then printing two elements, elements 1 to 2.

Printing something that wasn't inputted in the first place could print anything - anything from the meaning of life, to the character 'f' 3^(3^(3^3)) times. Fortunately the printf function isn't self-modifying, so there isn't a risk of it creating an unfriendly AI that will wipe out all life in the universe, unless the output is interpretted/compiled/executed by something somehow.


(array[0] is the first element in an array, not array[1], by the way.)
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 11 Feb 2003, 01:03   #19
DIABL0S
Guest
 
Posts: n/a
#include <stdio.h>


main()
{

/* Variable Declararion */

struct info {

int age;
int heighti;
int heightft;
char fname[20];
char lname[20];

} retrieve[2];


int wrap, ctr;
int rnum;

/* Loop Input Stage */

printf("Enter the number of inputs you wish to make (0 to quit): ");
scanf("%d", &wrap);

/* Main Information Retrieval Stage */

for (ctr=0; ctr<wrap; ctr++) {


printf("Enter First Name: ");
scanf("%s", retrieve[ctr].fname);
printf("Enter Last Name: ");
scanf("%s", retrieve[ctr].lname);
printf("Enter Age: ");
scanf("%d", &retrieve[ctr].age);
printf("Enter Height in Feet: ");
scanf("%d", &retrieve[ctr].heightft);
printf("..And Inches?: ");
scanf("%d", &retrieve[ctr].heighti);
printf("\nYour RETRIEVAL NUMBER IS: %d\n\n", wrap);

}

/* Output Stage */

printf("Enter your RETRIEVAL NUMBER:");
scanf("%d", &rnum);


printf("Last Name\tFirst Name\tAge\tHeight\n\n");

printf("%s\t%s\t%d\t%dft %din", retrieve[rnum].fname,
retrieve[rnum].lname, retrieve[rnum].age, retrieve[rnum].heightft,
retrieve[rnum].heighti);


return 0;

}

try this ^^
  Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 06:37.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018