Instead of putting in 40 for the for loop i want to get the length of the array which is where i want to store the information from the file. Would I use strlen or sizeof? Overall, how would i take in the information from the file and then store it in the array to get the size of the array in the for loop where the 40 would have been. Thank you. Also I am assuming to use strlen, correct?  Int40 *loadPlainText(char *fname){//declare function         int i; //for eventual for loop         char c;//declare character c         Int40 *Point=createInt40(); //call the create function because it returns a pointer to the int40 struct that holds an array filled with 0s         //something has to catch the value that the function returns. thats why its equal to  structure         FILE* ifp = fopen(inputFilename, "r");//opens thew file in read mode         int arr[40];//declare an array         for(i=0;i&lt;=40;i++){//for loop             fscanf(ifp, "%c", &amp;arr[i]);//read file into an array             Point-&gt;digits[i]=c;         }//end for loop         return Point;//return the pointer     }//end function
How can I figure out the size of a file, in bytes?  #include &lt;stdio.h&gt;  unsigned int fsize(char* file){   //what goes here? }
Can $R \times R$ be isomorphic to $R$ as rings? Converse of Schur's Lemma in finite dimensional vector spaces I am trying to prove (or disprove) the converse of Schur's Lemma in finite dimensional vector spaces. I am not sure if it holds in this case, but I have tried to apply the idea that proves it in representation theory (see for example Theorem 4.3  that uses Maschke's theorem or in questions  and ).  The converse of Schur's Lemma in finite dimensional vector spaces is:     Let $V$ be a finite dimensional vector space over the complex numbers. Let $S$ be a set of endomorphisms of $V$ and assume that every endomorphism $A$ of $V$ such that $$AB=BA\text{ for all }B\in S$$ is of the form $\lambda I, \ \lambda\in\mathbb{C}$. Then $V$ is a simple $S$-space.   (*an endomorphism of $V$ is a linear operator from $V$ to $V$  *$V$ is a simple $S$-space if the only $S$-invariant subspaces of $V$ are $V$ itself and the zero subspace)  What I've tried so far:  Assume to the contrary that $V$ is not a simple $S-$space. Then, there exists a subspace $W$ of $V$ such that $W\not =\{0\}$, $W\not= V$ and $W$ is $S$-invariant. Let $W'=V\setminus W$. Then, since $V$ is finite, we can easily prove that $V=W\oplus W'$ (this is my attempt to translate Maschke's theorem in vector spaces). Consequently, for every $v\in V$, there exists unique $w\in W$ and $w'\in W'$, such that $v=w+w'$. Define the projection $P:V\rightarrow V$ by $Pv=w$ for every $v\in V$.   What is left to prove is that $PB=BP$ for all $B\in S$. Then $P$ is clearly not a scalar and thus we have the contradiction we are looking for.  There is a difficulty in showing that $PB=BP$ for all $B\in S$, because $W'$ might be $S$-invariant or not. More precisely:   Let $v\in V=W\oplus W'$ and $v\not =0_V$.  If $v\in W$ then $Bv\in W$ because $W$ is $S$-invariant, therefore: $PBv=Bv$ and $BPv=Bv$.  If $v\in W'$ then $Pv=0$, hence $BPv=B\cdot 0=0$, and  (i) if $Bv\in W'$ then $PBv=0$.  (ii) if $Bv\in W$ then $PBv=Bv$ and this is where the problem occurs.  Any hints, ideas or counterexamples would be very helpful. What happens when you need to tear-down a hotel but no houses are in the bank in Monopoly? What is the meaning of “runneth” in ? Is there any way to recover unsaved notepad++ docs? How to defer variable expansion I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as:  str1='I went to ${PLACE} and saw ${EVENT}' str2='If you do ${ACTION} you will ${RESULT}'   and then later on PLACE, EVENT, ACTION, and RESULT will be set. I want to then be able to print my strings out with the variables expanded. Is my only option eval? This seems to work:  eval "echo ${str1}"   is this standard? is there a better way to do this? It would be nice to not run eval considering the variables could be anything. Is the wave function of a particle re-created after a measurement stops? Is $\mathcal{O}_{\mathbb{Q}(\sqrt{5})} = \mathbb{Z}[\phi]$, where $\phi={1+\sqrt{5}\over 2}$ is the golden ratio?  I know that $5 \equiv 1 \mod 4$, so that then $\mathbb{Z}[\sqrt{5}]$ is not closed as far as integers go. But I'm a little confused cause  $\mathcal{O}_{\mathbb{Q}(\sqrt{-3})} = \mathbb{Z}\left[-\frac{1}{2} + \frac{\sqrt{-3}}{2}\right]$? So how do I know when to use $\frac{1}{2}$ rather than $-\frac{1}{2}$? Which one applies for $\mathcal{O}_{\mathbb{Q}(\sqrt{5})}$? What should the standard spelling be - British or US? syntax error in case 'remove' when decrementing Is it possible to serialize and deserialize a class in C++? How to change color for a block of texts? Why is ${x^{\frac{1}{2}}}$ the same as $\sqrt x $?   I'm currently studying indices/exponents, and this is a law that I was told to accept without much proof or explanation, could someone explain the reasoning behind this.  Thank you. CodeIgniter Anchor error: URL not found on this server LED as power generator Ignore .DS_Store and Icon files in a folder with Cocoa NSFIleManager Can I install pantheon terminal in Ubuntu 14.04 or newer? Is it possible to install Pantheon terminal from elementary OS on my Ubuntu 14.04 or newer LTS releases? If yes, how can I? Why does:   $$ \sum_{k=0}^{n} k \binom nk p^k (1-p)^{n-k} = np $$ ? Taking the derivative of:   $$ \sum_{k=0}^{n}  \binom nk p^k (1-p)^{n-k} = (1 + [1-P])^n = 1 $$   does not seem useful, since you would get zero. And induction hasn't yet worked for me, since – during the inductive step – I am unable to prove that:   $$ \sum_{k=0}^{n+1} k \binom {n+1}{k} p^k (1-p)^{n+1-k} = (n+1)p  $$   assuming that:   $$ \sum_{k=0}^{n} k \binom {n}{k} p^k (1-p)^{n-k} = np  $$ What is the problem that gets worse after you try to solve it? Example sentence - This problem is a _____ which gets complicated every time you try to solve it.   Is there such a word that represents a problem which will become worse if/when one tries to solve it?  Note - After seeing the comments and answers I'd like to add that this is not a can of worms or Pandora's box because it doesn't create a new problem but just worsens.   Example: Magic leaves protecting a fruit by enclosing it. Every time a leaf is touched, all the leaves close together further, that is more tight than before. If $[G' : G'']\leq p^2$, then $G'$ is abelian.