If I used char, I can only scan literally one character at a time. For example, I wanted to scan 142 into x, I would have to scan 3 separate chars into separate variables and then convert it to 142....
Type: Posts; User: zyphirr
If I used char, I can only scan literally one character at a time. For example, I wanted to scan 142 into x, I would have to scan 3 separate chars into separate variables and then convert it to 142....
It's a simple program.
#include <stdio.h>
int main (void)
{
unsigned char x, y;
So, I add name and data to a linked list. I need a function to find a specific name.
Ex. find Smith
And using the hash table, I look through to find if smith is one of the names I added.
...
I don't get errors, my program just doesn't do what I want it to.
I don't know what you mean by changing blocks of data. I don't even know where to start changing.
The program is too large to...
Ok, so I need to use separate chaining hash in this program.
This is my function that is suppose to add a new hash after the data has been added to the linked list.
typedef struct node {
...
I'm trying to make a linked list, what's wrong with my syntax for adding a node?
struct data {
char name[20];
char number[10];
};
typedef struct node {
Ok, so say my text file is like this:
"The great big donkey, who was very
sad, leap into the pits of hell. Sucks to be him."
I would use: %20[^\n,. ]
That's line feeds (\n), commas,...
So is there no other way to ignore punctuations?
How can I use fscanf to read only the first character of each word in a text file?
Ok, thanks.
Now, how come %20[a-zA-Z] doesn't work?
Here's my code.
#include <stdio.h>
#include <stdlib.h>
int hash(char* s);
int main(int argc, char **argv)
Using that format, my program doesn't seem to be running.
Without it, it works but terminates with an error after the incorrect output.
I think it's in some kind of infinite loop.
When I use:
fscanf(file, "%20s", word);
...to scan a word in a text file, it includes punctuations. Is there a way to make it only alphabets?
What I'm trying to do is read each word...
works like a dream, with some minor revisions from master's code.
Thanks much everyone!
here ya go
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LESS(x,y) ((x).income < (y).income)
#define EXCH(x,y) { struct elecVotes tmp = x; x = y; y = tmp; }
#define...
forgot to mention that I changed that too.
still not working...
I didn't use .vote in my code, I noticed that master used it, so I changed it.
I'm using .income, but it still doesn't sort at all.
In my code, I just print the sorted list into a text file. ...
Ok, awesome. No more warnings or errors.
But...the program isn't doing what it's intended to do.
The bubSort function is suppose to bubble sort array, which is a struct elecVotes, by the...
dude, sorry if I didn't make it clear, lol.
the warnings and errors are in the code as comments
I thought I'd put it in the code because the code format doesn't have line numbers when I post...
The warnings and errors are in the code as comments on the line they belong to.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define EXCH(x,y) {struct elecVotes tmp = x; x =...
Hello! Ok, here we go.
If I have an array of unsorted integers, like:
2342
12344
234
21345
6788
No need to post the code Elysia, because I've fixed the errors on the Linux machine.
This isn't the first time I've had to do it.
I was contemplating those other options because I want to...
Thanks for clearing that up Elysia!
Ok, this is kind of off-topic, maybe.
So, I'm currently using MS Visual Studio C++ 2008 to write, compile, and test my C programs. (No C++ yet, just C) And...
Yes, master...
Tell me, how many times a day do you do this? Help out people like me.
I think you enjoy making me feel inferior. That's your perk isn't it? Sicko.
...
6 more!
void Move(char caaBoard[3][3], const EMove keMove) {
errors (from the above line and last line of entire code):