An algorithm is just the steps your program goes through, to do it's work. If your algorithm is wrong, no matter how well the rest of your program's output or performance might be, the program will not complete it's work, accurately.
Think of the steps you go through to go to work or school in the morning: wake up, clean up, get dressed, grab a bit of breakfast, get in your car and drive to work. Each is a step that would contain several steps of it's own. Some could be left out, like breakfast, but waking up is an essential step in the algorithm. Not only do you have to wake up, but you have to wake up *first*, before you can get anything else done.
Code:
print("%d", variable");
I don't think of an argument as modifying a function. I think of it as a little house warming gift, you're delivering to the function. The function must know how to respond to that gift, and since the eyesight ain't what it used to be, you tell it what kind of a housewarming gift it is that you've brought today. Flowers get dunked in a vase of water - but a CD would not!
Remember that C didn't just arise out of thin air. It was based on 'B', but included other idea's as well. The idea of "auto" was found overwhelmingly useful and popular, and made the default. I believe this was done in the early prototype of the language.
Code:
main(){
somefunction() {
int variable = 0;
repate:
variable++
}
goto repeate;
}
The result would vary from compiler to compiler, and OS to OS, but it would not be something you could rely on. When they talk about "undefined behavior", that's pretty much a euphemism for "you're totally goofed!"
The values differ in size, perhaps, but shouldn't differ in value when you declare a variable to be some value. Int i = 0, is still going to get i equal to zero, regardless.
Actually, it's used a great deal, especially by game programmers. It's not stressed in the learning phase too much, because the more formal if () code is more closely aligned with how people think.
Code:
#include <stdio.h>
int main(void)
{
int variable;
scanf("d%", &variable);
variable ? printf("false\n") : printf("true\n");
return 0;
}
Code:
int n;
scanf("%d", &n);
printf("%n tire%c", ((n < 2) ? c = ' ' : c = 's'));
(Note: I don't use this much, and it's not tested).
Pointers are critical in getting maximum efficiency out of the computer's hardware. If you have trouble with them, just use them a little bit, and gradually, you'll get used to them. The larger and more complex your program, the more you need pointers.
Static variables address a critical shortcoming of having just local variables. It's great when you can "encapsulate" the variable to within just the function that needs it. That way there's no chance of another function messing with it.
Returns can show you that the program made it through execution of any function, properly, usually by returning zero. Also, the returned number may be part of a critical calculation:
answer = 3.14159265358979 * radius_sqrd().
They're in their own subdirectories. Your compiler's doc's should tell you where the default location is. (Obviously the compiler/linker knows where they are, after all.
)
Yes, printf is written in C, but it's not a simple function.
Hexadecimal is helpful since the computers hardware groups bytes (with 8 bits), into words, which make up things like char's, integers, floats, etc. Hexadecimal is handy for memory locations and masking, and all kinds of things like that. It's compatible with the computer's hardware, and pretty easy for humans, as well.
Windows was originally coded in C, so the answer is definitely yes. C is also very much a commercial program, however, and stays independent of just PC's or just certain types of display monitors. I believe it tries a little too hard, but understand why it's done.
The L value has to be a variable that can receive a value. Constant variables would be an example of something that could not be an L variable.
Same thing - house warming gifts for the function.
Some problems are very eloquently solved by doing a little part of it, and then having the whole function call itself, taking the new value it's found, as a parameter, and then using that number to get even closer on the next recursive call, etc. Read the Wiki encyclopedia entry on Quicksort for a good example of recursion.
It's important to remember that ALL recursive functions can be replaced by a regular (iterative), loop construction, but the beauty of recursion, is that it's easy to program, small, and elegant.
That should give you a start!