I have looked through the forums for a problem similar to mine but given the specifics of my particular assignment, none of the posts (that I've seen so far) have similar structures.
I have an...
Type: Posts; User: cashmerelc
I have looked through the forums for a problem similar to mine but given the specifics of my particular assignment, none of the posts (that I've seen so far) have similar structures.
I have an...
I see, hk, that makes sense.
I've made a few changes to my code and I'm getting a new compiler error.
passing arg 1 of `fgets' makes pointer from integer without a cast
The user is...
Ah, thank you MacGyver, it didn't occur to me that I had to compile both .c files. Thanks man
I am writing a program that takes integers from a user and sorts them in ascending order. I understand the process of most of the steps but our teacher has said that the actual function that...
Okay, I have written out some code that puts together several small strings into one long one, but the -1 character only seems to have an effect if you happen to make the -1 the 1st, 2nd, 3rd, 6th,...
I have a program to write where a user enters up to 10 strings, ending the input with -1 to let the program know the user is finished. Then takes those strings and compares them to remove...
This is what I currently have. I've been messing with declarations and things just to see if it makes any difference, so I know the type identifiers are probably all wrong.
void sub_sum(float...
strtod() can be used to parse floats. And according to all of the sites I've found explaining the function, it is of the format:
strtod(const char *nptr, char **endptr, base)
so assuming nptr...
Okay, using strtok(a, b), the command will search through a to find a character that doesn't match what is in b and then turns the character after that into a null character.
so if a = 1.000+2i,...
I'm writing a program in which a user enters a complex number (a + bi). I need to store the real numbers a and b in floating points *x1 and *i1 respectively but I'm having a hard time figuring out...
Yeah, do I need to use the && operator between them?
p1.c:121: error: conflicting types for 'checkWinner'
And the error is on line 121, which is actually the line:
char checkWinner(char cell[])
I'm writing a tic tac toe program and I have a problem with the function that determines whether or not there is a winner. When I try to compile, it gives me an error saying there are conflicting...
I have a menu driven program that should point towards several functions depending on the user's input.
One of the functions is supposed to prompt the user to enter a string and then determine...
Okay, I have the program more or less written but the output shows nothing but zeros for the two prime numbers being added.
i.e.
4 = 0 + 0
6 = 0 + 0
etc..
Here is my code:
I have been tasked with writing a program that allows a user to input a lower bound and an upper bound so the program can show that every even number between the two is the sum of two primes.
...
Yeah, that makes sense. Thanks mike
<<split from here>>
I have a question about the following code:
int x = 0, y = 1, z;
int i;
for ( i = 0; i < 10; i++ ) {
That works perfect, thanks man. That was driving me nuts. :)
Alright, I nested some ifs else ifs into the switch, which isn't a short series like you advised but I don't know how else to do it.
The program I'm writing allows the user to input a two digit...
When you have a list of cases in a switch function can you nest ifs and things of that nature in a single case?
using the && method worked, thanks for your suggestion, greatly appreciated.
Alright, I have written a program for class that allows the user to input three integers then sorts then and prints them in ascending order.
It works sometimes but sometimes it prints strange...
Yeah, right after I asked the question I noticed that guy's thread. Sorry about posting a similar one.
/me takes time to check first next time
Now that you pointed it out, that seems like an obvious mistake. *slaps forehead*
Thank you very much for the help!