See the comment section in the code. There I explained what I want to understand and what I know.    How I can get 28 using ptr. sizeof(arr) is giving me 28. (length of array elements) * sizeof(int) But I can't figure out how to get this value using ptr. I want this thing so I can get an array length using this method. In function own here.    int main (void) {     int arr[7] = {5, 8, 10, 50, 55, 98, 354};     int result;      /* ------- From here ---------*/      int size = sizeof(arr) / sizeof(int);   // sizeof(arr) = 28, sizeof(int) = 4. So size = 28/4 = 7      result = anyFunction (arr);      return 0; }    int anyFunction (int array[])  {        int arraySize = sizeof(array) / sizeof(int);   // this line }     int *ptr = arr;  // Same as *ptr = &amp;arr[0]  size = sizeof(ptr);  // 8 is the size of pointer.   size = sizeof(*ptr);  // size = 4.  4 is the size of arr[0]. Because its pointing to arr[0]. So its sizeof(arr[0]) or sizeof(5)
First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?
I let him do it.   and     I allow him to do it.   Why does the latter require to?  What are the "rules" of using to with an infinitive? When is it necessary? Here's a screen capture from a site where I can view /site-analytics:    The orange "all posts" curve should be strictly larger than the blue "questions" curve, but they are mistakenly displaying the same data. As the title says, I've heard two possible meanings for turning down the air conditioning: It could mean set the target temperature lower (i.e. colder) or make it work less (i.e. warmer).  Turning down the heat makes it colder, but both meanings are in agreement there. Quick way to remove solidify thickness I have made the mesh and added solidify modifier and applied. But later i thought to increase the thickness. So now i want to remove thickness so that i can added the solidify modifier again. I want to know is there any quick remove thicknes. When i select the edge then ctrl+ the selection goes downward not to single face. So i want to know a quick way to decrease thickness. Any suggestion or help. Suppose we have a natural number $n \ge 0$.  Given natural numbers $\alpha_1,\ldots,\alpha_k$ such that   $k\le n$ $\sum_i \alpha_i = n$   what is the maximum value that $\Pi_i \alpha_i$ can take?  I'm quite sure that there is a theorem telling me the result, but I cannot find it. For sure an upper bound is $n^k$ but I'm searching for a real upper bound. I'm pretty sure that upper the bound should be $n^2$, but I don't know I could prove it. How to evaluate the limit $\lim_{x\to 0} \frac{1-\cos(4x)}{\sin^2(7x)}$ Access NSMutableArray from another class - Objective C Can't install xposed framework I want to install the xposed framework on my Nexus 5 and in the framework, the install/update option doesn't work.  My Nexus 5 runs Android 5.0 (Lollipop). My question is, if you create a new domain user account for each of the SQL Server processes, what permissions should be set for each account? Or does the SQL configuration manager actually take care of this, and I just had an unforeseen issue?  I quite often have to setup Microsoft SQL Server and wondered if anyone can provide advice on configuring the accounts the services should run as. IMO this has been vaguely documented by Microsoft, while they point you in the right direction I have never been able to find any concrete examples.  To summarize what I've seen so far:  For simple deployments\development environments it is OK to use the virtual account defaults the installer uses: e.g. NT SERVICE\MSSQLSERVER  Avoid using the SYSTEM account, this is not secure.  For production and in domain environments it's recommended to use either a Managed Service Account, or create a domain user account (not an admin) for each service. Allegedly if you use a domain account at installation time the installer will set any required permissions for you.  If changing the service account on an existing install from a virtual account to a domain account the recommendation is to use the SQL Server configuration manager to set the new service accounts. Allegedly this will set any required permissions for you.  I just tried changing the service account in an existing install to a domain account and it would give me a logon failure until I granted the account log on as service permission, which contradicts the part where the SQL Server configuration manager will set any required permissions. (Although I'm not sure if a GPO may have interfered with setting this local security policy)  Microsoft does provide a list of the permissions that the SQL Server Setup grants .  But it's not clear to me if that is something I should be doing manually for the user I create to run the service as, or whether using the SQL config manager should automatically set these permissions.  SQL Server 2014, Domain Controller is on Windows Server 2008 R2. What is a magic number, and why is it bad? What is a magic number?  Why should it be avoided?  Are there cases where it's appropriate? Space between 2 paths in Illustrator Often, TeX outputs underfull hbox and vbox warnings when running and in the generated log file. What are these and how can I get rid of them? Sell your home and invest in growth stock mutual fund I purchased a home and I made an agreement with a guy who is living in that home and paying me monthly rent. Since I live with my brother I don't have to live in my purchased home.  The rent I'm getting is only 10% of total cost of home while stock fund industry (mutual fund) is paying 20% minimum i.e. I'm getting 10% loss every year and that is a big amount.  I'm not really sure if my home also increase it's value by 10% every year. But I don't think it will be.  Now I'm thinking of selling that home and investing all of my money in a growth mutual fund. Any advice? My computer boots to a black screen, what options do I have to fix it? I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents: How do you prove that $\sum\limits_{n=0}^{\infty}{2n \choose n}x^n=(1-4x)^{-1/2}$? I tried to identify the sum as a binomial series, but the $4$ and the $-1/2$ puzzle me. (This series arises in studying the first passage time of a simple random walk.) Reputation and inbox notification shows up again after refresh This was asked before too. .  Currently I am facing the issue of appearance of reputation notification in above toolbar.  I can see the reputation notification, for every page refresh even after clicking and viewing the notification.  current browser: Chrome Version 36.0.1985.143 m What properties do natural isomorphisms between functors preserve? If $F,G: C \rightarrow D$ are functors between regular categories and $F \Rightarrow G$ is a natural isomorphism, is it true that if $F$ is faithful {resp. full) then $G$ is full?  I believe this is true but would like some confirmation.  What about if $F$ is essentially surjective?  Is it necessarily true that $G$ is essentially surjective?  Thanks. Why do people have darker skin in sunnier climates? How to display quick-updating images without large memory allocation? Encopresis, I'm at my wits end? Does anybody have suggestions?