« first day (1108 days earlier)      last day (2748 days later) » 

08:36
@Kamiccolo beautiful ASCII-art, well done :)
helloc all;
@PeterVaro well, done it once, so... just copy-pasted from:
08:52
@Kamiccolo still nice though ;)
 
4 hours later…
12:44
Hi guys , how is it going? Can anyone recomned good materials for state machines , also performance wise are switch/case superior to the pointer function?
13:25
Hi all :)
I have one very fast questions (to short for write on global stack)
14:24
@KirkBrodie shoot :}
Can i use notatnion like void foo(int a) {int tab[a];}? I know that i cant return this. But this is fine? Every function call, i have diffrent space on function stack?
@du4ko mhm. I guess.... switch/case allows more compiler optimizations. Well, try Your case, benchmark and perf Your bottlenecks ;)
Ok, thx:)
I m fear abaut memory error.
@Kamiccolo Okay, thx mate
14:41
@KirkBrodie You should not do that.
Why?
I know that function stack is short so for huge tabe better using malloc.
@KirkBrodie could You please show full example. Because here, You're not returning anything :}
int tab[somethingsomething]; return tab[a]? Then is valid.
You're returning int by value.
I ony ask abaut stack in function :)
For exemple, if i have void foo(int a, int b){int tab[a]; int tab2[b];} compiler guarantee that tab and tab2 have separate space (adress) every function call?
But now i test it :)
15:13
@KirkBrodie not sure what exactly are You trying to do here.
15:25
Nevermind now :)
 
4 hours later…
19:09
helloc all;
@du4ko what?! switch case vs pointer function? what is a pointer function? what are we talking about? :)
btw you don't need to know more on FSM that what has been said in the wiki-page:
A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some external inputs; the change from one state to another is called a transition. A FSM is defined by a list of its states, its initial state, and the conditions for each transition. The behavior of state machines can be observed in many devices in modern society that perform...
well, if you have any question particular to a corner case, or a specific scenario, then ask, but the main concept is fairly easy, to implement and work with is also straightforward.. so, yeah, be specific :)
@KirkBrodie what you are doing there, is a valid C99+ code, and it is called the variable-length-array
I don't know if you are looking for that or not, but it is a thing
basically you are defining the size of the array on runtime, but in the stack instead of the heap (note: neither stack not the heap are standard based expressions, the standard does not care about these memory concepts)
anyway, as such, it is very fragile, and you can easily get stack overflow -- so consider it twice, before you are actually using that feature
(it can be useful, and can have its usecases, especially if you know your hardware's limitations, and you can estimate the number 'a' in a range, which is in the range of your limitation
anyway, since those are "allocated" on the stack, you can't return them, because they will cease to exist once they go out of scope, which will happen at the end of the function call
so if you need something that will outlive your function, then you should allocate them on the heap, with the "malloc" function for instance
helloc @Kevin;
 
1 hour later…
20:43
helloc all;

« first day (1108 days earlier)      last day (2748 days later) »