sscanf never returns eof, it returns the count of
variables it managed to scan in.
Try
while (sscanf (......) != 0)
{
.
.
.
Type: Posts; User: C-learning
sscanf never returns eof, it returns the count of
variables it managed to scan in.
Try
while (sscanf (......) != 0)
{
.
.
.
Mabey a good idea to show us some code :-)
Mabey a good idea to show us some code :-)
if ((T->left == NULL) && (T->right == NULL))
return 1;
Dont you get wrong result with this code?
You should be counting up every time you visit a leave and when
the no leave exist, you...
int searchX(char string[], char dict[], char dictSpace[]){
char *p;
p = strtok(string, " ");
int len = strlen(string);
do{
p = strtok('\0', " ");
...
Wasnt i actually saying this or is my english bad?
int any(char s1[], char s2[])
{
int i,j;
for(i = 0; s1[i] != '\0'; i++)
{
for(j = 0; s2[j] != '\0' && s2[j] != s1[i]; j++)
{
if (s1[i] == s2[j])
...
Update and have you cleaned it away from the register?
But what if you get an EOF in the inner getch() ?
Kaputt?
EDIT: not getch(), getchar() :- )
I cant really understand what the problem is but
one thing i can see is that you call put_row with wrong arguments
put_row(c, step, stop);
shouldnt it be:
int point_size (char *a)
{
int i = 0, pointer_eh;
while (*(a+i) != '\0')
{
*(a+1);
i++;
}
UL = unsigned long
i think :-)
number & (1UL<<n)
if you want to see if the 6:th bit is set in number ,then n = 6
The result of the operation is 1 if its set and 0 if its not.
You have declared str as int *
This could be ok, but then you would have to cast it to char
before comparing with '\0'
like
while(((char)*(str+i))!= '\0')
easiest would be to change int...
void cutline(void)
{
extern char s[];
int i;
extern int len;
for (i = len; i > 0; i--)
if (s[i] == ' ')
s[i] == '\n'; / * this must be wrong what about s[i]='\n'...
void reset_board()
{ int i=0, n=1;
for(i=0; i<=8; i++)
{
board[i]=n;
n++;
}
}
Why not use the comma operator , like this:
(result!=5) ? (a++,b++) : (C+=2,D-=2);
Should work fine.
K.N.KING called C Programming: A Modern Approach
Actually its a GREAT book!
I remember doing the same program then.
Its because the '\n' character.
Fgets dont read the line character, leaves it. So
next time when scanf starts to read it finds the '\n' char first and stop reading.
After fgets, test if '\n' was...
Thats true.
But i was never good at math...
:D
while(1) is 8 letters
for( ; ; ) is 7 letters...
:D
Use CODE tags
Shouldn you try sum == num
after the loop.
ANd if im not that wrong you never get a perfect number because
you start with 2.
1 is the divisor of all numbers and you never add 1 to sum.
And it...
Really liked this page
Ok, thanks for the help.
Now i see the big picture.