unsigned char is ok, but
LED[0]
would not work, since this will access the first byte of LED - you want to access the first bit
try something like this to set the first bit to 1
*LED = *LED...
Type: Posts; User: IceBall
unsigned char is ok, but
LED[0]
would not work, since this will access the first byte of LED - you want to access the first bit
try something like this to set the first bit to 1
*LED = *LED...
Using a pointer would be a good idea, i guess. ;-)
yeah MK27 thats correct
i was reffering to b-k24's code --> an opening-brace requires always a closing-brace.
it's missing a } at the end
If "i" is an int too, you would not need to use x - you can use i instead.
the loop i posted will run 6 times - i will be 0 the first time (since it's initialized by i = 0; ) and incremented by 1 every run (i++; )
So you will be able to use target[i] inside of the loop...
you want to use a for-loop
for(i = 0; i < 6; i++) {
// your code here
}
i'm using lccwin32 most of the time. an other famous one would be MS visual studio of course...
localtime( ) will return a struct tm*
struct tm is defined as
struct tm {
int tm_sec; /* seconds */
int tm_min; /* minutes */
int tm_hour; /* hours */
...
a long long int contains 64bit so there is a number range of 9223372036854775807 to -9223372036854775807.
13 digits shouldn't be problem for long long int.
pasted it into my ide - works fine for me (result is -997 in a random matrix setup like yours)
can you tell us what u are expecting and what u are getting..?
:confused: so my best guess is that theres something wrong with matrix[currentR,currentC] <- i'm not sure about that. i'd have used somthing linke &matrix[currentR][currentC]
hm..
is matrix[currentR][currentC].bestFromStart already filled at this line?
expecting "value" is a positive number - i would say this statement is never true when...
You have to call your function after the "scanf-line" - thats the main point, why it's not working ;) .
The call should look like this: time(time, &hours, &mins...
"&hours" represents the adress of...
you have to reset i to 0, before running into theloop :)
you could also use strcpy to copy the new string into the old buffer.
char *strcpy(char *str1, const char *str2);
edit: argh.. too slow
maybe they did so, because in assembler the dest also stands on the left side?
this statement would be true:
since 0x7 = 0111 bin
and 0x2 = 0010 bin
-> the result of the & operation is 0x2
and this is not 0, so its True :)
hmm cant find the code.. but it looked like this:
int thread2() {..}
int thread1() { clone(..., thread2,...);...}
int main() {clone(..., thread1,...); ...}
thank you for the replys.
i already used the posix threads one day after my first post. So i have no more problems with multithreading.
But i'm still interestet in the fac, why the 2. clone call...
hi everybody. :)
im playing around with the clone() syscall to implement multithreading. My problem now is, that every time i try to clone() a thread out of another clone()d thread the program...
for windowed apps i really like this method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/wsaasyncselect_2.asp
isn't isalpha() a standard function -> i guess ctype.h
you can access the elements of a struct with this "->" operater, if there is just a pointer to the struct.
i guess you need to have a look at functions with variable number of arguments