How does the following program work to initialize a 2D Array, store data in it and then calculate the sum of all the elements. I am actually bothered about how dynamic memory allocation is actually working in this code. This approach is new to me as I couldn't find any resource that could explain this code. #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;  #define col 5 int main(){     int n, i, j, sum =0;     int (*a) [col];     printf(&quot;Enter number of rows: &quot;);     scanf(&quot;%d&quot;, &amp;n);     a = (int (*)[col])malloc(n * col * sizeof(int));      for(i = 0; i &lt; n; i++){         for (j=0; j &lt; col ; ++j){             //pointer to 5 elements row             scanf(&quot;%d&quot;, &amp;a[i][j]);             sum+= a[i][j];         }     }      printf(&quot;Sum : %d\n&quot;,sum);      free(a);     return 0; }
This question attempts to collect a community-maintained list of quality books on the  programming language, targeted at various skill levels.  C is a complex programming language that is difficult to pick up on-the-go by reading online tutorials. A comprehensive book is often the best way to learn the language, and finding a good book is the first step. It is important to avoid badly-written books, and even more importantly, books that contain serious technical errors.  Please suggest edits to the accepted answer to add quality books, with an approximate skill level and a short blurb/description about each book. (Note that the question is locked, so no new answers will be accepted. A single answer is being maintained with the list)  Feel free to debate book choices, quality, headings, summaries, skill levels, and anything else you see that is wrong. Books that are deemed satisfactory by the C community here will stick around on the list; the rest will be regularly removed.  For books that have reviews by the Association of C and C++ Users (ACCU), a link to those reviews should be added along with the book.  See also:   Other C-related resources in the   A similar list for :      This question was discussed on  as part of the .The consensus was to keep it undeleted and actively maintained.
Period character used for local computer name I'm wondering about the period character . used as a shortcut for the local computer name.  You can use it when logging into Windows 7, for example, to specify that the user account you're entering belongs to the local computer rather than to a domain:  .\MyLocalUserAccount   And you can use it within a Windows Management Instrumentation (WMI) query to indicate that the target is the local computer rather than a remote computer.  You can also use it when working with named pipes to for similar purposes.  However, you cannot use it as the UNC network name for the computer, like this:  \\.\MyShare   Does this character have an official name (e.g. "LocalHostToken") and when and where can it be used for this purpose? is there a way to request a new tag be created? Possible Duplicate:          I do not have sufficient reputation on any site to create new tags, but I do on occasion find myself in need of a tag that does not exists.  Is there a feature that allows for a person with sub-1500 reputation to request a new tag? Is there proof that the DSA construction, also used by ECDSA, is secure assuming that discrete logarithms in the relevant group representation are difficult? Let $S$ and $T$ be finite non-empty sets such that $|S| = |T|$. Show that the function $f : S\to T$ is onto if and only if it is one-to-one. This is a recent homework bonus question assigned in my Proofs and Conjectures class. It (evidently) includes and evaluates our understanding of elementary-set theory and how to determine and prove that the function f is onto and one-to-one. I haven't been able to really grasp firmly how it is we do this. Help would be much appreciate, thank you. Proof of matrix norm property: submultiplicativity Overload a C++ function according to the return value Up arrow under a sequence How to find the magnetic field due to a revolving electron of hydrogen atom in first orbit I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :)   I also use Microsofts  framework, utilizing the UpdatePanel. The reason why I do that is that certain elements are created on the page based on some server-side logic. I don't really want to explain why I use the UpdatePanel - even if it could (it can with quite some effort) be rewritten to use only  I still want that UpdatePanel.  You probably guessed it - once I have a postback on the UpdatePanel the jQuery events stops working. I actually was expecting this, since the "postback" is not really a new postback so my code in document.ready that binds the events won't be fired again. I also confirmed my suspicion by reading up on it in the jQuery help libraries.  Anyway I'm left with the problem of rebinding my controls after the UpdatePanel is done updating the . I preferably need a solution that does not require adding more .js files (jQuery plug-ins) to the page but something as simple as being able to catch the UpdatePanel's 'afterupdating' where I can just call my method to rebind all the form elements. AppleScript to read all notifications in the Notification Center OSX 10.10 Yosemite It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite): on run     tell application &quot;System Events&quot;         tell process &quot;Notification Center&quot;             set theseWindows to every window             display notification (count of theseWindows)         end tell     end tell end run  This were supposed to get all notifications listed in the Notification Center. However, the count attribute always returns 0. Does anyone know how to retrieve all notifications in the Notification Center different than the script above? Prove that $a_{n}=0$ for all $n$, if $\sum a_{kn}=0$ for all $k\geq 1$ Minimal $ab$ for Rational Number $a/b$ in an Interval Given rational numbers $L$ and $U$, $0&lt;L&lt;U&lt;1$, find rational number $M=a/b$ such that $L \le M&lt;U$ and $(a\times b)$ is as small as possible---$a$ and $b$ are integers. For example,    If $L=66/101$ and $U=19/29$ then $M=17/26$. If $L=66/101$ and $U=19/28$ then $M=2/3$.   Right now I'm using a naive search that is exponential in complexity. Is there a better method?  If it is of any help, it can be assumed the prime factorization of numerator and denominator of $U$ and $L$ are known. How to make Table of Contents manually I'm trying to make table of contents manually, I mean I set the page of each of sections one by one. Here's my target:  and I'm using book class here.  Here's the code that I found   \documentclass[oneside]{book} \renewcommand\contentsname{CONTENTS} \renewcommand\listtablename{LIST OF TABLES} \renewcommand\listfigurename{LIST OF FIGURES} \addtocontents{toc}{{\bfseries Contents\hfill Page No.\bigskip\par}} \addtocontents{lot}{{\bfseries No.\hfill Title\hfill\hfill Page No.\bigskip\par}} \addtocontents{lof}{{\bfseries No.\hfill Title\hfill\hfill Page No.\bigskip\par}}  \usepackage[titles]{tocloft} \usepackage{xcolor,xpatch} \renewcommand\cftbeforechapskip{0ex} \renewcommand\cftchapfont{\mdseries} \renewcommand\cftchappagefont{\mdseries} \renewcommand\cftchappresnum{Chapter~} \renewcommand\cftchapaftersnum{. } \newlength\tocindent \settowidth\tocindent{\cftchapfont\cftchappresnum9\cftchapaftersnum} \edef\cftchapnumwidth{\the\tocindent} \edef\cftsecindent{\the\tocindent} \advance\tocindent2.3em \edef\cftsubsecindent{\the\tocindent} \advance\tocindent3.2em \edef\cftsubsubsecindent{\the\tocindent} \renewcommand\cftsecdotsep{\cftnodots} \renewcommand\cftsubsecdotsep{\cftnodots} \renewcommand\cftsubsubsecdotsep{\cftnodots} \newcommand\tocmainmatter {\renewcommand\cftchappagefont{\color{white}}% } \xapptocmd\mainmatter{\addtocontents{toc}{\protect\tocmainmatter}}{}{}   \newif\ifschaptertoc \makeatletter \renewcommand\@makeschapterhead[1]% {{\parindent \z@ \centering     \normalfont     \interlinepenalty\@M     \Large \bfseries  #1\par\nobreak     \vskip 20\p@ }% \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% \ifschaptertoc \addcontentsline{toc}{chapter}{#1}% \fi } \makeatother  \usepackage{blindtext}  \begin{document} \frontmatter  \tableofcontents \schaptertoctrue  \chapter*{ACKNOWLEDGEMENTS} \blindtext  \chapter*{ABSTRACT} \blindtext  \listoftables  \listoffigures  \chapter*{ABBREVIATIONS} \Blindtext  \chapter*{NOTATIONS} \Blindtext  \mainmatter  \chapter{INTRODUCTION} \blindtext  \section{General Background} \blindtext  \section{Objective} \blindtext \subsection{Objective 1} \blindtext \subsection{Objective 2} \blindtext \subsection{Objective 3} \blindtext  \section{Scheme} \blindtext \end{document} What should be maximum and minimum length of persons User Name & Password? I am wondering because I am trying to make sure that person have right amount of spaces for their user name.  User Name and Password are security measures and should not be easy to guess. I have fixed amount of characters to Passwords no shorter than 6 characters because most sites use 6-8 characters when create an account. Because of limitation of my progams database file I cannot have passwords longer than 20 characters. What about User Name field? Too short User Name would be too easy to guess, too long, might cause program errors (since maximum length of single line TextBox in .Net/C# is about 32767 characters).  What should be the maximum and minimum length of User Name and Password fields? Why did skilled wizards use He-Who-Must-Not-Be-Named? Pursuant to , it's plausible that the typical witch or wizard would use 'He-Who-Must-Not-Be-Named' (if they assume Taboo Spell is intact after death of Voldemort). But, why would the Aurors and those in the Ministry of Magic (who had first rate protection) also use it? Even Snape (the Half-Blood Prince) hesitated to say 'Voldemort', and he was under the protection of Dumbledore, Dumbledore being the only wizard Voldemort ever feared.  What was the point of the Death Eaters being scared to say 'Voldemort' when, ostensibly, Voldemort wasn't even alive? Yes, it's true that some believed Voldemort would return, but, at the time, it was just that -- a belief. Were people scared that the Death Eaters might give a list of all those who used Voldemort's name to Voldemort upon his return? TeXnicCenter & Adobe Reader DC For some time, Microsoft has supported an option to remove the limit of 260 symbols for NTFS file name length.  The web is full of articles, describing what should be done.   Hit the Windows key, type gpedit.msc and press Enter. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS. Double click the Enable NTFS long paths option and enable it.   However, I don't have such option. Please see the screenshot below:    Am I missing some Windows update, or is it something else? I went to the doctor's I have run across such a sentence:     Yesterday I was ill, so I went to the doctor's.   What is the function of possessive here, that is doctor's? Finding a clear difference between truth and fact I have been starting back in school after a long hiatus.  In one of my classes, a discussion of Truth began.  The problem I have had is that no one seems to have a solid definition between the two.   My earlier training and schooling left me with this definition, and I would like some feedback.  Fact - A point of data that can be directly qualified/quantified through confirmed, standardized measurement.  Truth - A point of data not directly qualified/quantified through confirmed, standardized measurement.  So fact would be that ice cream is cold, as we can place a measurement of the temperature.  Ice cream being tasty would be truth, as it is impossible to accurately measure "tasty".  Please let me know your thoughts. Given matrices $A$ and $B$, where that $AB = A + B$, prove $AB = BA$. I keep coming up with AB = AB. It seems like basic algebra, but for the life of me, I'm getting nowhere :/. Someone help please?