I'm trying to write a simple program to calculate the number of common factors for two numbers.I am stuck with segmentation fault(core dumped) occurring while scanning the second number.I don't understand where is the fault?  #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;  int main() { long long int first,second,t,k; long long int i,count=0; scanf("%lld",&amp;first); scanf("%lld",&amp;second); //storing the lowest of two numbers in t   if(first&lt;second){     t=first; } else{     t=second; } //initialising an array to be used as flags int com[t]; for(i=0;i&lt;t;i=i+1){     com[i]=1; } for(i=0;i&lt;t;i=i+1){     if(com[i]==1){         if(first%(i+1)==0&amp;&amp;second%(i+1)==0){             count=count+1;         }         else{             for(k=2;k*(i+1)-1&lt;t;k=k+1){                 com[k*(i+1)-1]=0;             }         }     } } printf("%lld\n",count);  return 0; }
The following code is generating a stack overflow error for me  int main(int argc, char* argv[]) {     int sieve[2000000];     return 0; }   How do I get around this? I am using Turbo C++ but would like to keep my code in C  EDIT:  Thanks for the advice.  The code above was only for example, I actually declare the array in a function and not in sub main.  Also, I needed the array to be initialized to zeros, so when I googled malloc, I discovered that calloc was perfect for my purposes.  Malloc/calloc also has the advantage over allocating on the stack of allowing me to declare the size using a variable.
Set the location in iPhone Simulator Power Supply Capacity Formula Freeze vertical columns in horizonal scrolling visual force page (like excel freeze pane) let's say have 20 columns total.   I want to fix till 5 columns. (means only important ID, etc will be fixed while doing horizonal scrolling)  How can I achieve it in Visual Force Datatable ? Why are properties lost in the Cayley–Dickson construction? Motivating question:    I'm aware that one can construct a hierarchy of number systems via the Cayley–Dickson process:  $$\mathbb{R} \subset \mathbb{C} \subset \mathbb{H} \subset \mathbb{O} \subset \mathbb{S} \subset \ldots $$  "Reals" $\subset$ "Complex" $\subset$ "Quaternions" $\subset$ "Octonions" $\subset$ "Sedenions" $\subset$ $\ldots$  and that at each step you're given a multiplication table that tell how the elements interact. As you move up the ladder, certain "nice" properties are lost: ordering,  commutativity, associativity, multiplicative normedness, etc... Given the multiplication table, you can show that these properties don't hold.   Eric Naslund noted that "the first 4 are very special as they are the unique 4 normed division algebras over ℝ", no surprise then that these $2^n$-ions have found quite a bit of use. I'm interested in the sequence itself however, irrespective of how useful a $2^{256}$-ion might be (ducenti-quinquaginta-sex-ion?).   I feel like something deeper is going on here though that I don't understand. Why are these particular properties lost at each step? Is it possible to quantify the process such that, at the $2^n$-ion you can say something about the symmetry of the multiplication table*?  * I'm making an ansatz that there is a connection between the symmetry of the multiplication table and these "nice" properties. I'm trying to run  sed -i "/$variable/c \$variable1' file.txt   But it's not displaying any change in the file: file.txt.  But the same command, with out the variables works fine:  sed -i "/variable/c \variable1' file.txt I just came over this syntax in some of the questions in this forum, but Google and any other searchengine tends to block out anything but letters and number in the search so it is impossible to search out "=>".  So can anyone tell me what it is and how it is used? Editing default custom object home screen I would like to add a custom button (URL to Flow) to my default home page for my custom object. Currently, I have a default "New" button to create a new record (see attached screen shot). I'm wanting to add my Flow custom button to this page. Is there a way to do this?  Cheers, Sean. Ubuntu 14.04 LTS live USB boot error (gfxboot.c32:not a valid COM32R image) Somewhere in the provided answer:   $$\int \frac{1}{\sqrt{2-x^2}} dx = \sin^{-1}{\frac{x}{\sqrt{2}}}$$  How did they get that? What I have:   $$\frac{1}{\sqrt{2-x^2}} = \frac{1}{\sqrt{2(1-\frac{x^2}{2})}} = \frac{1}{\sqrt{2} \sqrt{1-\frac{x^2}{2}}}$$  $$\frac{1}{\sqrt{2}} \int \frac{1}{\sqrt{1-(\frac{x}{\sqrt{2}})^2}} = \frac{1}{\sqrt{2}} \sin^{-1}{\frac{x}{\sqrt{2}}}$$  So I have an extra $\frac{1}{\sqrt{2}}$ ... I probably had some stupid mistakes? # and ## in macros Is QImage able to open and render pure 16-bit images? C++ single template specialisation with multiple template parameters I want to change only the color (not font size, etc.) of all headings in my documents (\section, \subsection, \subsubsection, ...). I want to keep all other settings fixed.   Is there a way to do this? Mathematical Induction Question About A Basis Step Is there a (Unix) shell script to format JSON in human-readable form?  Basically, I want it to transform the following:  { "foo": "lorem", "bar": "ipsum" }   ... into something like this:  {     "foo": "lorem",     "bar": "ipsum" } Dobble card game - mathematical background In  there is a deck of 55 cards. Each of them has 8 symbols on it. There is a total of 50 different symbols and each two cards have one and only one in common.  I am wondering, given a total number of symbols N and a number of symbols on each card K, how do you find the biggest number of cards such that:   on each of those cards there are exactly K of the N symbols, every two cards have one and only one symbol in common. Android Studio shortcuts are not working I use Android Studio in Ubuntu and everything was working fine. Since two weeks that shortcuts stopped working, Ctrl+C, Ctrl+V, Ctrl+Z. I tried to change Keymap in Settings but without success.  What could be the possible problem? How would I import/export Blender's preferences? Our 3 months old baby is very keen on rolling over and being on his stomach. Most of the time he automatically rolls over in a few minutes after we put him on his back, including during bed time. Is this dangerous? We are particularly worried that   his nose maybe blocked when facing down it is said that SIDS risk increases when a baby sleeps on his stomach   If it is dangerous, how can we stop this, especially during bed time or other times when we can't watch him continuously? When did Tom Riddle get his new face? Recently I asked about the  pertaining to Voldemorts new face. However I was corrected by ...     Well, I think the confusion comes with mixing movie canon with book canon. In Philosopher's Stone, here's what Harry sees when Quirrell unwraps his turban:           Harry would have screamed, but he couldn’t make a sound. Where there should have been a back to Quirrell’s head, there was a face, the most terrible face Harry had ever seen. It was chalk white with glaring red eyes and slits for nostrils, like a snake.          Philosopher's Stone - page 212 - UK - chapter 17, The Man With Two Faces      So it seems at some point between leaving school, and sticking his face to the back of Quirrel's head possessing Quirrel he got a new face some how.   How did he manage that? Is it some dark magic he applies? Is it from possessing snakes in Albania?