Skip to main content

All Questions

Tagged with
0 votes
3 answers
127 views

How multiple type lists are stored in memory?

Arrays are stored in a linear fashion, with memory cells of fixed size for each element. To have fixed sized memory cells Arrays should be homogenious. So in Arrays we get an Nth element by skipping ...
forty5's user avatar
  • 39
1 vote
2 answers
148 views

Linked-list iteration patterns

If you have a linked-list, where the items are not necessarily close to each other in memory, wondering if it is (in general) better/worse/no difference to do the following. Say you want to iterate ...
Lance Pollard's user avatar
-1 votes
1 answer
2k views

Why is it possible to access an array out of bounds with negative indexes much further than with positive indexes?

I have written two small programs in which I declare a very small array. Then I try to access values out of bounds. The interesting thing I noticed that when I try to decrement the index I can ...
yoyo_fun's user avatar
  • 2,297
20 votes
3 answers
6k views

Professional way to produce a large problem without filling up huge arrays: C++, free memory from part of an array

I'm developing a physics simulation, and as I'm rather new to programming, I keep running into problems when producing large programs (memory issues mainly). I know about dynamic memory allocation and ...
Drummermean's user avatar
1 vote
1 answer
102 views

Is it possible to quickly change an array declared on the stack to one declared on the heap

I have about 5000 lines of code which manipulates a large array in C++. The problem is that when I try to make the array even larger i.e. A[10000][10000], the gcc compiler throws me a segmentation ...
Fraïssé's user avatar
  • 113
-1 votes
2 answers
373 views

Estimation of space is required to store 275305224 of 5x5 MagicSquares? [closed]

Here are some examples of 5x5 Magic Squares found by some good solvers : Magic Square Generator by Marcel Roos this program state using 2.4GHz Intel takes about 95 hours to generate all solutions. ...
Fereydoon Shekofte's user avatar
5 votes
1 answer
223 views

At ping, why do we have to do array copying instead of passing on the source array that the client sent to us?

So I have been googling about this OpenSSL heart-bleed thing and somehow sees that it is caused by the heartbeat extension which requires client to ping the server to show its aliveness and it all ...
vcharlie's user avatar
2 votes
1 answer
245 views

Handling Dynamic amount of Strings for persistent and runtime storage in an IOS App

Background I am dynamically building an FQL query statement and because of the nature of the app, I exclude FB family members, this is the base portion of the query and remains fairly static. The ...
drD's user avatar
  • 23
-2 votes
4 answers
2k views

C simple arrays and pointers question

So here's the confusion, let's say I declare an array of characters char name[3] = "Sam"; and then I declare another array but this time using pointers char * name = "Sam"; What's the difference ...
Nash Vail's user avatar
  • 101