you could pass that kind of pointer with a struct, also. :)
struct array {
char *rows; //char stands for *type*
char *columns;
} Array
Type: Posts; User: marbia
you could pass that kind of pointer with a struct, also. :)
struct array {
char *rows; //char stands for *type*
char *columns;
} Array
the function works fine, while looping.
i don't really understand why the 'if' goes all the checks, over the '1', to the hell. :)
ok, man i was only asking what's going on; don't know why your 'shrug'.
i don't understand, however, why the 'if' construct doesn't work properly. he makes his job nicely only for the input=1. on...
does it mean i have to change the structure of this code?
i'm not asking someone will do a job for me, absolutely.
i've checked the code, seems to be ok, check for the '1' is ok and the return is...
sure
it should work as in this case;
input 10.
10 is even then 10/2 = 5 (step=1)
5 is odd then 5*3+1 = 16 (step=2)
16 is even then 16/2=8 (step=3)
8 is even then 8/2=4 ...
thanks for the input :)
something strange is happening.
compile: ok
the function assigns always 1 thou, whatever is the input.
here's an example;
I think a silly syntax error then; i post the code..
#include <stdio.h>
#include <stdlib.h>
main()
{ int n;
My first post here.. :)
you should make assignments after the right declarations, it works fine for me. hope this helps.