OcttKB/Wiki-OcttKB/tiddlers/Normal/_C Language.tid

14 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-10-30 00:53:41 +01:00
created: 20231029134919585
creator: Octt
2023-11-03 01:23:03 +01:00
modified: 20231102232811333
2023-10-30 00:53:41 +01:00
modifier: Octt
tags:
title: C Language
<<^wikipediaframe C_Language>>
* [[Why do many functions that return structures in C, actually return pointers to structures?|https://softwareengineering.stackexchange.com/questions/359408/why-do-many-functions-that-return-structures-in-c-actually-return-pointers-to-s]]
* [[Passing by reference in C|https://stackoverflow.com/questions/2229498/passing-by-reference-in-c]] --- "C does not support passing a variable by reference"... //Passing a pointer ''is'' passing-by-reference. This seems to be one of those facts that "savvy" C programmers pride themselves on. Like they get a kick out of it. "Oh you might THINK C has pass-by-reference but no it's actually just the value of a memory address being passed harharhar". Passing by reference literally just means passing the memory address of where a variable is stored rather than the variable's value itself [...]//
2023-11-03 01:23:03 +01:00
* [[strcpy vs. memcpy|https://stackoverflow.com/questions/2898364/strcpy-vs-memcpy]] --- //strcpy stops when it encounters a NUL ('\0') character, memcpy does not//, aka as the names suggest often strcpy is perfect for strings while for generic data memcpy could be needed.
* [[ISO C90 forbids mixed declarations and code in C|https://stackoverflow.com/questions/13291353/iso-c90-forbids-mixed-declarations-and-code-in-c]] --- old C standards required that new variables can be declared only before any other actual instruction in a scoped block, e.g. only at the top of a function