the word "stack" has been mentioned multiple times in this thread, would really appreciate if someone could explain in detail? does this have anything to do with compile-time allocation vs. run-time...
Type: Posts; User: brassbin
the word "stack" has been mentioned multiple times in this thread, would really appreciate if someone could explain in detail? does this have anything to do with compile-time allocation vs. run-time...
Salem, would you mind elaborate on that? what is this "stack" you were referring to?
this code snippet compiles and runs fine
#include <stdio.h>
int main(void) {
int i, a[i];
i=2;
Thank you!
so running the following code
#include <stdio.h>
int main(void) {
char c;
int i=1;
thank you! that worked, may i ask why it had to be an explicit comparison? wouldn't implicit conversion take care of the returning "int" value of scanf() to a TRUE, and only errors such as EOF to...
linux on a PC
Ctrl+Z just backgrounds it
so i'm using scanf() this way
int i;
while (scanf("%i", &i))
printf("%i ", i);
printf("\ndone\n");
Thank you all very much for your help!
anduril462, just want to say this, i'm telling myself as i type up this reply, that i shouldn't expect my future questions to be answered with this level of...
i apologize, the actual code i was compiling with has more lines to it, i thought i dump it down to simplify the question, could you try with these 2 code samples, the gcc version shows 4.4.7
...
so i had code "test.c" like this
#include <stdio.h>
#include <math.h>
int main(void) {
float f;
f=pow(2.1, 2);
printf("f is %f\n", f);
Thank you all for your help!
i kind of understand what you are saying :-) that "%f" is merely a formatting string, and that's how C does things, but still if you just read the above quoted, it's quite ambiguous, and that's the...
why doesn't integer to float conversion kick in here
printf("%f", 1)
it kicks in here
float f;
int x=3, y=2;
i'm trying to understand how the float/integer conversion mechanism works here, i intentionally made up the code like that, i was expecting "1.000000", in fact i had something like
float f;
f =...
why does the following code output "0.000000" instead of "1.000000"?
#include <stdio.h>
int main(void) {
int x=3, y=2;
printf("3/2 is %f\n", x/y);
return 0;
}