This is an old revision of the document!
Functions are a core component of any programming language. In C, there can only be one per function. Parameters are the parameters of the function. When compiling, adding a -g at the end of the line add in a debugging tool. It slows the program down a little. To use it, use gdb ./program. Then use run command to run program. Any arguments come afterward. To anylize it, use type in bt.
These last few weeks, arrays were discussed. An array utilizes a chain of memory 'slots' that are next to one another. An array, when started, will either clear those slots or just write over them, keeping the information that isn't written over. How arrays can be used though, that's a whole different matter that I've yet to understand.
If-then statements were covered more in depth. In addition, the the gnu collection compiler was discussed more in full. The compiler can be stopped at any of the 4 steps that it goes through when compiling. Goto statements were covered as well, although it isn't recommended that it should be used.
Throughout this week, if-then statements were discussed. Common in other languages, if-then statements work just the same, even with the inclusion of else. However, there are else if statements that will allow statements that essentially mean “but if this happens, do ___”.
This week, I've been confused with the arc0 project. Part of it was the fact that I forgot how to cd into the archive's directory. The other part of it is the fact that I can't find a way to extract the files from the archive. I did remember that screen -r takes me to the class chat though.
I'm beginning to learn more about how the the unix operating system. Unix is a move to focus OS, unlike Windows that is click to focus. Left clicking opens the main menu, where one can exit or open web browsers. Hopefully I'll get more acquainted with unix operating systems in the future.
This week was just a bunch more scripting. It's very similar to regular coding, however it's with plain old command line commands. Nothing new was really learned so I guess I'll just keep this week short. Potato.
Scripting can be done to make command operation based tasked possible. Simply type the commands into the file and then run it. No compiling needed. #!/bin/bash allows the use of command line commands.${var.}isolates variables, allowing for expansion without confusion. Use spaces if they're needed. Don't if they aren't. bc stands for binary calculator. Use bc -l if you want float variable.
Today the kill command was discussed. It's a basic process but it has the capability to end almost any process. ps is a command that shows all of the running processes on the pc. In addition, one can pause a process via ctrl^Z. It can then be looked up with the custom, three letter command: jobs.
This week, the root of the system was discussed. A unix operating system is structured in a way where it al starts at one point, but that point splits off into more and those so on and so forth. with basic commands (CD ..) one can get into the the root directory. After all, in the unix world, everything is a file. Everything.
This week, path structures were embedded into my head. By cd'ing into the home directory (root), one can look at all of the files in a system. With the command ls -l, one can look at files in respect to permissions. The lines would be divided as such: -|—|—|— where the first part defines the file, the second is what the user has access to, third being what the group has access to and finally the last one with what the world has access to. r, w, x all mean read only, write only, and executable only respectively.
This week, I've been confused with the arc0 project. Part of it was the fact that I forgot how to cd into the archive's directory. The other part of it is the fact that I can't find a way to extract the files from the archive. I did remember that screen -r takes me to the class chat though.
I'm beginning to learn more about how the the unix operating system. Unix is a move to focus OS, unlike Windows that is click to focus. Left clicking opens the main menu, where one can exit or open web browsers. Hopefully I'll get more acquainted with unix operating systems in the future.