Taking input as string 1 - " C-String to Int "

Converting C-Strings to Integer If you want to convert a C-string (zero-terminated array of chars) of digits, you can call one of the library functions to do this (good idea), or write something like the following (good exercise). Character codes for digits Every character is represented by a pattern of bits. These patterns can be thought of as integers. If your system uses ASCII (or any of the newer standards), the integer value of the code for ‘0’ is 48, ‘1’ is 49, etc. [Read More]

Self reproducing program in C

main(){char\*p="main(){char\*p=%c%s%c;  
 (void)printf(p,34,p,34,10);}%c"  
 (void)printf(p,34,p,34,10);}

Hirschberg’s linear space algorithm in C++

It should work on any container type which supports forward and reverse iteration. It’s similar to the Python implementation, but note: rather than copy slices of the original sequences, it passes around iterators and reverse iterators into these sequences rather than recursively accumulating sums of sub-LCS results, it ticks off items in a members array, xs_in_lcs /\* C++ implementation of "A linear space algorithm for computing maximal common subsequences" D. [Read More]