notes:cprog
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:cprog [2018/11/07 14:59] – [Projects] sdiarra | notes:cprog [2018/11/20 08:24] (current) – [Other] sdiarra | ||
---|---|---|---|
Line 51: | Line 51: | ||
**String Formating(fprintf)** | **String Formating(fprintf)** | ||
http:// | http:// | ||
+ | |||
+ | **Standard Template Library** | ||
+ | http:// | ||
+ | |||
+ | |||
+ | **Vector Reference** | ||
+ | http:// | ||
======Notes====== | ======Notes====== | ||
<color # | <color # | ||
Line 73: | Line 80: | ||
Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer, | Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer, | ||
+ | ------- | ||
+ | <color # | ||
+ | |||
+ | Undef is a directive in that is available in C and C++. It as the form of #undef when called. Undef is used as a complement to the #define, as a preprocessor directive it is used to enclosed a #define statement to make sure there is no naming conflict and constrict one's logic within a set of code. Let's take a macro for example it is efficient for macros primarily because of the fact that it does common tasks such print, as many modules take have various print functions, the ideal way to make sure there is no conflict is to use undef. This is how it is used: | ||
+ | |||
+ | < | ||
+ | #define pprintf1() //for pretty-printf | ||
+ | #undef pprintf1() | ||
+ | </ | ||
+ | |||
+ | easy peasy! | ||
======Other====== | ======Other====== | ||
+ | ------- | ||
+ | <color # | ||
+ | |||
+ | Recently I have discovered a trick that could help run scripts much quicker with direct access to one's lab46 account, without working only on a single machine at a time. Ultimately, I had to ssh into my account, and whenever I left the terminal open for a few minutes, it would go offline - or had to share scripts between my personal laptop and lab46 machines, and work on projects on one machine at a time(fairly painful). With this method one can easily call commands anywhere, that are otherwise only available on the lab46 account. Here is how it is accomplished: | ||
+ | < | ||
+ | system(" | ||
+ | </ | ||
+ | A working example would be the following: | ||
+ | < | ||
+ | // | ||
+ | | ||
+ | |||
+ | // | ||
+ | |||
+ | </ | ||
+ | **Note that the script would prompt you to enter your <color # |
notes/cprog.1541620768.txt.gz · Last modified: 2018/11/07 14:59 by sdiarra