Question: I am using the Laravel 5.6 Storage API to store my files in `public/storage/images`. This works fine. When I want to retrieve a full URL for one of these files, I use

```
$path = Storage::disk('public')->url('images/' . $url);

```

This returns

> 
> <http://localhost:1234/public/storage/images/foobar.jpg>
> 
> 
> 

But since my server is set up to ignore `public`, this address does not return the image. Instead, this address:

> 
> <http://localhost:1234/storage/images/foobar.jpg>
> 
> 
> 

returns the image. Is there any way to produce this address using Laravel's API, rather than doing an ugly find & replace?

Answer: 
Yes, the sizes of types are implementation-dependent. In particular, the size of a pointer to `int` and the size of an `int` are dependent on the C implementation (primarily a compiler) and may be different from each other.

The assertion in the question contained in “the base address of the array(*which is 4 bytes for an implicit pointer variable and integer variable both*)” is false, in general. It is true in some C implementations but is false in others.

The code `sizeof(arr)/sizeof(arr[0])` inside a function declared with `void print(int arr[])` prints the size of a pointer to `int` divided by the size of an `int`.

While C implementations are heavily influenced by the architectures and the operating systems they target, they may choose the sizes of their types for reasons other than execution speed, such as goals of supporting smaller memory use, supporting code that was not written to be fully portable to any type sizes, or supporting easier use of big integers.
`Are the variable sizes compiler dependent ?` Yes it depends on the compiler but that doesn't mean architecture point of view is irrelevant . Also it depends on architecture whether it's `16/32/64` bit system for e.g, in `16-bit` machines, `sizeof (int)` is `2` bytes, in `32-bit` machines it's of `4` bytes.

It has been considered `int` was the native size of a processor, i.e., the size of register. 

Here in function argument `arr[]` is a pointer not an array.

So if system is `32` bit system then 

`sizeof(arr)/sizeof(arr[0]);`

Will result in `1` as `4/4 = 1`.

I find @Eric comments very true & interesting about compiler and architecture role in defining variable size.

> 
> The sizes of types are ultimately determined by the C implementation
>  (notably the compiler), not the architecture or the operating system.
>  While C implementations are usually heavily influenced by the
>  architecture, computers are effectively Universal Turing Machines, so
>  that any desired choices for sizes can be implemented. C
>  implementations sometimes choose sizes based on considerations of what
>  source code is to be supported rather than what is most efficient for
>  the architecture. They may even support a choice of sizes via
>  command-line switches.
> 
> 
>