for (n = 0 ; n < j ; n++) {
for (a = 0 ; a <= j/2 ;a++) {
if (x == k[n]+k[a]) {
printf("%d = %d + %d\n",x,k[n],k[a]);
return (0);
}
}
}
You are having...
Type: Posts; User: dinjas
for (n = 0 ; n < j ; n++) {
for (a = 0 ; a <= j/2 ;a++) {
if (x == k[n]+k[a]) {
printf("%d = %d + %d\n",x,k[n],k[a]);
return (0);
}
}
}
You are having...
Couple of things.. you should probably call week(string) after you scan the value using scanf
then do something like:
if (!(strcmp(today, "Saturday") || !(strcmp(today, "Sunday")) {
!!!...
I think what NeonBlack was saying is that he commented out part of your code and it works.
At least if the user's input is sane.
;)
try using isspace() to skip over whitespace
oh wait, I'm an idiot.
I think you need the double pointer because of memory allocation.
If you did what I just told you too, this is what i think the problem would
be:
#include <...>
void...
#include <...>
void fun(int *myInt);
int main(void)
{
int j;
fun(&j);
}
void fun(int *j)
Why don't you try compiling it with all of your compiler's warnings enabled?
For my compiler (gcc) I tell it to give me more warnings and to nitpick by using
the
-pedantic switch to nitpick and...
yes, it could just be an int* if the code actually
did anything. There arent any functions being called
in your code, only function declarations, and those are
incomplete.
work on Saturday?
yuk :/
I think the main problem you are having is in your AddFront function.
You are inserting at the beginning of the list but dont update the previous
node value for the old first element. Something...
to get you started, how about getting rid of the semi-colon at the end of this?
the semicolon causes nothing to be executed inside of the while loop
instead, do something like
while(...
Programming in ANSI C by Stephen Kochan
Good for: Learning ANSI C.
Not good for: May not be much information on "advanced" features of C.
man, dont give up so easy... use his suggestion and roll with it, perhaps to google?
and maybe do a search for something like ... hmm
C format specifiers
or maybe you should just store your...
argh! finally broke the top 5 and now am moving and then leaving town for a few weeeeeks. O(well)
i think you might want to look at:
and
]GoogleAgain[/COLOR]
http://www.google.com/search?hl=en&q=C+isdigit%28%29&btnG=Search
ok. [sshhhh!] I did it with globals [/sshhhh!] :)
thnx.
dinjas
I'm writing a program that needs to accept PID's of running processes (*NIX) from the command line. So the call to my program would look like
$ ./myprogram 1324 1328 1400
that part is all fine and...
looks like strcmpi() is C++
strcasecmp() is C (GNU) [ and is not case sensitive.
dinjas
good call, I didn't think of that.
as mentioned in the other post, you don't need to do anything special with printf unless you're printing the value of a variable.
ex.
printf("this is a...
I believe strcmp is case sensitive, so it might not be a bad idea to prompt your user to enter a choice that begins with a lowercase C since that is what you're checking for. (i.e. Choice != choice)...
ok, read your post a little slower...
int yourfunc( int value )
{
//test whether value is even or odd
...
if it's odd
Your program doesn't work?
if (remainder )
{
printf("You entered %d, it is odd.\n"
"Here's your 0.\n\n", integer1);
}
else
{
printf("You entered %d, it is even.\n"
you realize this would only count the days that are the hottest and coolest , give their average, and say that it is the average for (number of hottest days + number of coldest days -1) days?
The...
you don't assign an initial value to i so it doesn't know what its value is in your do-while loop
int i;
there's no format specifier for printf
printf("Your answer", answer);