Hey all That was exactly what my problem was i was missing 2 functions that i needed to declare in my class what a rookie mistake! Ah well lesson learned its...
Hi guys, Newbi here . I am trying to read a quadrature rotary encoder and porting some BASIC code over to C. I got it to decrement properly . But incrementing...
... if (bla) { do something } else { do something else } Thanks, Tyler Littlefield Web: tysdomain.com email: tyler@... My programs don't have bugs,...
Tyler Littlefield
tyler@...
Apr 1, 2009 10:22 pm
69924
Thanks Tyler, That did the trick . I googled it after I sent off the message and made the second {} brackets but didn't have the "else" statement. You cleared...
... Hi Csaba - I'm interested in your definition of IOPIN. Is it memory mapped eg. #define IOPIN (*(unsigned char *)0x1234) Because in C it can help to use the...
this may be very basic but plz., help How to pass an array(1 Dimensional) to a function, multiply its elements by 2 and return to main function and assign to...
well, you want to pass a pointer to the array, not sure what you mean by multiply it's elements, possibly multiply each element of the array? then return the...
Tyler Littlefield
tyler@...
Apr 2, 2009 2:11 pm
69930
pass the array as reference in the function. void chArray(int *array) { array[0] = 4; } int main(void) { int arr[] = {1,2,3}; ... chArray(&arr[0]); ... return...
as reference? that's as pointer. Thanks, Tyler Littlefield Web: tysdomain.com email: tyler@... My programs don't have bugs, they're called randomly...
Tyler Littlefield
tyler@...
Apr 2, 2009 2:41 pm
69932
The thread on returning arrays from a function raises a question to my mind. Is there a way to determine how many elements are in the array without explicitly...
... Not in C. You could perhaps have a struct: typedef struct _array{ void* array; int* count; } _array; and pass that around instead of the raw array. (The...
sizeof(array)/sizeof(array_type) Thanks, Tyler Littlefield Web: tysdomain.com email: tyler@... My programs don't have bugs, they're called randomly...
Tyler Littlefield
tyler@...
Apr 2, 2009 2:56 pm
69935
... I think that the question was asking if the called function could determine the size of the array, not the calling function. I think that the answer is...
... it's worked before. :p Thanks, Tyler Littlefield Web: tysdomain.com email: tyler@... My programs don't have bugs, they're called randomly added...
Tyler Littlefield
tyler@...
Apr 2, 2009 3:11 pm
69939
On Thu, Apr 2, 2009 at 4:05 PM, Michael Sullivan <msulli1355@...> wrote: [..] ... All it has is a pointer to the first element of the array - (you're not...
... If you use an array as an argument to sizeof then it gives you the total size of the array which is good, however the called function is given a pointer to...
... Sorry, I should have said that my question wasn't anything to do with your 'else' question - I just wanted to check that you were aware of the 'volatile'...
a hunting dog! A pointer is something that is pointing to a place in memory.... hence pointer. When I learned 'C' (dinosaurs still on earth) I was taught there...
Michael Comperchio
mcmprch@...
Apr 2, 2009 5:12 pm
69949
ok. I was thinking c++, you can pass reference which is diff from a pointer. Thanks, Tyler Littlefield Web: tysdomain.com email: tyler@... My...
Tyler Littlefield
tyler@...
Apr 2, 2009 5:21 pm
69950
Remembering the reason for references in c++ is to hide the implementation of things (whatever things might be). References are part of the OOP design. The...