Here in the code written below, when I am passing the two dimensional matrix( in this case it is nMatrix[][]) , and in the function i\I am storing that into a double pointer. Then a problem is being created in accepting the elements of the array.   If I perform the same task using dynamic memory allocation and I keep the function syntax same, then it works perfectly. I want to know the reason, if anyone can help I will be thankful to him/her.  #include&lt;stdio.h&gt;  int inputMatrix(int **matrix , int row, int column) {     int i, j, nonZero  = 0;     printf("\n Enter the elements of the matrix : \n");     for(i=0; i&lt;row; i++)     {         for(j=0; j&lt;column; j++)         {             scanf("%d",&amp;matrix[i][j]);             if(matrix[i][j]!=0)                 nonZero++;         }     }     return nonZero; } int main() {     int nMatrix[10][10], sMatrix[10][3], nr, nc, i, j, ch, nonZero;  // input the matrix in normal form                 printf("\n Enter the number of rows : ");                 scanf("%d",&amp; nr);                 printf("\n Enter the number of columns : ");                 scanf("%d",&amp;nc);                 nonZero = inputMatrix(nMatrix,nr,nc); return 0; }   In eclipse it does not show an error, and in Code::Blocks it shows note which is    note: expected ‘int **’ but argument is of type ‘int (*)[10]’
I am trying to pass a reference to a two-dimensional array to a function in C++. I know the size of both dimensions at compile time. Here is what I have right now:  const int board_width = 80; const int board_height = 80; void do_something(int[board_width][board_height]&amp; array);  //function prototype   But this doesn't work. I get this error from g++:  error: expected ‘,’ or ‘...’ before ‘*’ token   What does this error mean, and how can I fix it?
Why was Padmé made to clean an astromech? Reading  (the Amidala stand-in) I remembered that I always wondered why she ordered the actual queen to scrub R2-D2. There were enough actual servants who could have done it, so why Padmé? If that wasn't enough, after giving the actual queen (Padmé) the order to go away, she tells Panaka to continue with the discussion. How does that make sense?  The significant piece of dialogue:     AMIDALA : Thank you, Artoo Detoo. You have proven to be very loyal...Padme!    ...    AMIDALA : (Cont'd) Clean this droid up the best you can. It deserves our gratitude...(to Panaka) Continue, Captain.   Note that this question is two-fold:   Why was Padmé chosen in the first place? Why would an important meeting with the ship's captain be continued without her? How can I explain to people that the phrase “off of ” is grammatically incorrect? How can I explain to people that the phrase off of is grammatically incorrect?  I‘ve heard this phrase used a lot, especially by Americans (though they aren't the only ones).    In my understanding, off of should usually be replaced by off, as in,     I took the book off the shelf   as opposed to     I took the book off of the shelf   Am I wrong?  Or is there perhaps some simple way I can explain this to most people? Not enough storage I have an 8GB iPhone. I've had not enough storage for a while so I went through my photos and deleted 100. I also deleted old notes that I don't need. I also deleted an app of 81.5 MB. I tried downloading an app of 22.1 MB but it's telling me I don't have enough storage. Is this a bug or do I just not have enough storage? What is the origin of "man on the spot"? What is the origin of "man on the spot" ?   defines on the spot and uses as an example man on the spot.     on the spot -  at the place in question; there; "they were on the spot when it happened"; "it had to be decided by the man on the   spot" (Emphasis added)   Some evidence suggests that the origin of the phrase refers to decisions made by officials of the past British empire and actions taken by them. Rewrite Sharepoint URL (Sharepoint 2013) I'd like to rewrite all my site urls in the way the the user can't figure out the exact name of the the page his viewing. let's say that my site is "www.justarandomsite.com"  and may page is "page.aspx" I' like to have instead of "www.justarandomsite.com/pages/page.aspx" sothing like this: "www.justarandomsite.com/skdhfjksdgfjksdgfjdsgvdjhsgfjdsdsjfgkdsjgfkdsgfjdsgfjkdsg" How do I enable the "partner" repository? I keep seeing places refer to the "partner" repository as a place I can get software, how can I enable this repository? Please specify how to do this graphically and via command line. Diagonalizable Operators and characteristic polynomials Why do damaged hard drives freeze the entire system? I have to prove that:     $$\sum_{k=0}^{n} {{m+k} \choose{m}} = { m+n+1 \choose m+1 }$$   I tried to open up the right side with Pascal's definition that: $$ { n \choose k} = {n-1 \choose {k}} + {n-1 \choose {k-1}}$$  Here is what I came up with, and I am sure it is wrong because it does not equal the left side:  $$ {m+n+1 \choose m+1} = {m+n \choose m+1} + {m+n \choose m} = ... ={m+n \choose m+1} + {m+n-1 \choose m} + {m+n-2 \choose m-1} + ... + {m \choose m+1} = \sum_{k=0}^{n} {m+k \choose m+k-n+1 }  $$  Which, again, probably is wrong because it is not equal $\sum_{k=0}^{n} { m+k \choose m}$. Any help is appreciated Locking an iPhone if button is broken? My friend's iPhone's sleep/wake button no longer works. Is there any way to turn off the screen besides setting up auto-lock and waiting a few minutes? Explanation of terminal objects using limits I understand terminal objects, but I falter when trying to achieve them using the approach of diagrams, the category of constant diagrams $\mathcal{C}^{\mathcal{J}}$ and limits.  I have the empty category 0, now I have a diagram $D: \mathcal{J} \to \mathcal{C}$. However this diagrams image should be empty, because there are no objects or morphisms to map. At this point, I'm confused, because I can't get to the universal property $\forall c \in \mathcal{C}. \exists! f: c \to T$ anymore, because I'm missing T. (EDIT: I get that this is how it is supposed to be)  But continuing with the category of constant diagrams, even if I have a constant diagram mapping everything to one object / morphism, there is nothing to map, so the functors image is still empty. So now I'm missing both $T$, and any kind of $c$.  EDIT: It seems to me, have I chosen 1, instead of 0, I would have come up with that is considered the definition of the terminal category. What am I missing? I had a look at Knuth's The Art of Computer Programming, book 1. In chapter 1, section 1.2.2, exercise 25, he presents the following algorithm for calculating logarithm:  given $x\in[1,2)$, do the following:  L1: [Initialize] Set $y\leftarrow0$, $z\leftarrow x/2$, $k\leftarrow1$.  L2: [Test for end] If $x=1$, stop.  L3: [Compare] If $x-z&lt;1$, go to L5.  L4: [Reduce values] Set $x\leftarrow x-z$, $z\leftarrow x/2^k$, $y\leftarrow y+\log_b(2^k/(2^k-1))$, and go to L2.  L5: [Shift] Set $z\leftarrow z/2$, $k\leftarrow k+1$, and go to L2.  (The algorithm needs an auxiliary table which stores $\log_b2$, $\log_b(4/3)$, and so on, to as many values as the precision of the computer.  Then Knuth concludes: this exercise is to explain why the above algorithm will terminate and why it computes an approximation of $y=\log_b x$.  Well, I see that it works, but I am not able to explain why... Propane gas fireplace pilot won't light For simple linear regression, the regression coefficient is calculable directly from the variance-covariance matrix $C$, by  $$ C_{d, e}\over C_{e,e} $$ where $d$ is the dependent variable's index, and $e$ is the explanatory variable's index.  If one only has the covariance matrix, is it possible to calculate the coefficients for a model with multiple explanatory variables?   ETA: For two explanatory variables, it appears that $$\beta_1 = \frac{Cov(y,x_1)var(x_2) - Cov(y,x_2)Cov(x_1,x_2)}{var(x_1)var(x_2) - Cov(x_1,x_2)^2} $$ and analogously for $\beta_2$. I'm not immediately seeing how to extend this to three or more variables. In Inkscape when I apply a dash stroke, then set a mid marker shape, it does not show anything. I created a custom module in drupal 8. And I am trying to add js and css file in  my_module.libraries.yml file using this   lrv_key:   version: 1.x   js:     js/lrv.js: {}        dependencies:       - core/jquery       - core/drupalSettings   css:     theme:       css/lrv.css: {}   But it doesnt work. Aliens abduct mathematician, astronomer, woman Bits I remember about this SF movie which probably originated in late 50s / early 60s:   Humans are flying in a light, general aviation, high winged, single engine aircraft. An alien in a flying saucer abducts the whole kit &amp; kaboodle (plane &amp; passengers). Takes them to a secret terrestrial base Eventually tells them that his computer is damaged and he needs their help to get back to his planet. He needs an astronomer for planetary masses &amp; other information. He needs a mathematician to calculate trajectories and perform other calculations. He needs the woman as eye candy, lol They eventually make it back to the alien home planet which is under attack by its enemy. The attacking aliens are bombarding the original alien's home planet with meteors / asteroids.   That's about all I remember. Why (in relatively non-technical terms) are Calabi-Yau manifolds favored for compactified dimensions in string theory? Every finite group is isomorphic to some Galois group for some finite normal extension of some field. I believe there are several ways to prove that $\sum\limits^{\infty}_{n=1}\left(1-\frac{1}{\sqrt{n}}\right)^n$ converges. Can you, please, post yours so that we can learn from you?  HERE IS ONE   Let $n\in\Bbb{N}$ be fixed such that $a_n=\left(1-\frac{1}{\sqrt{n}}\right)^n.$ Then, \begin{align} a_n&amp;=\left(1-\frac{1}{\sqrt{n}}\right)^n \\&amp;=\exp\ln\left(1-\frac{1}{\sqrt{n}}\right)^n\\&amp;=\exp \left[n\ln\left(1-\frac{1}{\sqrt{n}}\right)\right] \\&amp;=\exp\left[ -n\sum^{\infty}_{k=1}\frac{1}{k}\left(\frac{1}{\sqrt{n}}\right)^k\right]\\&amp;=\exp\left[ -n\left(\frac{1}{\sqrt{n}}+\frac{1}{2n}+\sum^{\infty}_{k=3}\frac{1}{k}\left(\frac{1}{\sqrt{n}}\right)^k\right)\right]\\&amp;=\exp \left[-\sqrt{n}-\frac{1}{2}-\sum^{\infty}_{k=3}\frac{n}{k}\left(\frac{1}{\sqrt{n}}\right)^k\right]\\&amp;\equiv\exp \left(-\sqrt{n}\right)\exp \left(-\frac{1}{2}\right)\end{align} Choose $b_n=\exp \left(-\sqrt{n}\right)$, so that  \begin{align} \dfrac{a_n}{b_n}\to\exp \left(-\frac{1}{2}\right).\end{align} Since $b_n \to 0$, there exists $N$ such that for all $n\geq N,$ \begin{align} \exp \left(-\sqrt{n}\right)&lt;\dfrac{1}{n^2}.\end{align} Hence, \begin{align}\sum^{\infty}_{n=N}b_n= \sum^{\infty}_{n=N}\exp \left(-\sqrt{n}\right)\leq \sum^{\infty}_{n=N}\dfrac{1}{n^2}&lt;\infty,\end{align} and so, $\sum^{\infty}_{n=1}b_n&lt;\infty\implies \sum^{\infty}_{n=1}a_n&lt;\infty$ by Limit comparison test.