I am studying for my final, which is tomorrow. It is an intro to C class and I have just a couple questions. He gave us this sample final and I don't get a couple of them and was seeing if someone...
Type: Posts; User: stewade
I am studying for my final, which is tomorrow. It is an intro to C class and I have just a couple questions. He gave us this sample final and I don't get a couple of them and was seeing if someone...
WAHOOOOOOOOOOOOO! Man alive, thank you so much. You are a lifesaver. I really really appreciate it!
Here's my bubblesort code I'm using for reference to my previous post:
void bubbleSort(int numbers[], int array_size) {
int i, j, temp;
for (i = (array_size - 1); i >= 0;...
Seems to be having the same problem. I think the problem might be in bubblesort, but I can't seem to figure it out, the code looks correct to me :confused:
Please enter name: stewart
Please...
This doesn't make any sense why it's doing this, but my input/output is as follows:
Please enter ID: 10
Please enter name: a
Please enter ID: 9
Please enter name: b
Please enter ID: 8...
I actually fixed the input so it reads it like this:
for (i = 0; i < k; i++) {
fflush(stdin);
printf("Please enter name: ");
fgets(buffer,...
When I compile, it gives me this error:
a8-2.c: In function `main':
a8-2.c:26: warning: implicit declaration of function `strdup'
a8-2.c:26: warning: assignment makes pointer from integer...
Thank you very much, that definitely solved my name input; however, it doesn't seem like the bubblesort is even working for some reason. My input is this:
Please enter name: a
Please enter ID: ...
Ok, this is what I put in for my input:
Please enter name: a
Please enter ID: 1
Please enter name: b
Please enter ID: 2
Please enter name: c
Please enter ID: 3
Please enter name: d
Ok, I've run into another compiler error, most likely because of sheer stupidity on my part. The compiler error reads:
a8.c: In function `main':
a8.c:33: error: request for member `id' in...
Wahoo! I changed it to a regular "int" and it worked. Thanks man. I have another part to the problem I have to figure out, so I am going to try and figure that out...you never know, I could be back...
Wahoo! I changed it to a regular "int" and it worked. Thanks man. I have another part to the problem I have to figure out, so I am going to try and figure that out...you never know, I could be back...
The error I get from the compiler is:
a8.c: In function `main':
a8.c:25: warning: int format, different type arg (arg 2)
I think that solves my name input, but the problem when it comes to compiling involves my "int" input - the ID number. I've been able to input the name, but I can't get the other to work. Any ideas...
I have this assignment and am trying to just first get my input correct. I can't seem to get the int input right. I posted earlier and have read the FAQs, but can't seem to get it. I keep getting:
...
This is what I have had so far. I don't know how to read in an integer for the ID and then I don't know how to pass it to the bubble array.
#include <stdio.h>
void bubbleSort(int numbers[],...
The input will come from the keyboard. The output will look something like this:
Please enter name: Stewart
Please enter ID: 123
Please enter name: Joe
Please enter ID: 456
for 10 names/ids....
Basically, I have an assignment and have NO clue. Can someone please help? Here is the assignment along with the link for the bubble sort:
In this assignment you are to implement an array of 10...