Btw , another question not related to this subject but programming in general:
Is there a difference in performance when doing operations with 64 bit variables vs 32 types ? And I'm not talking...
Type: Posts; User: patishi
Btw , another question not related to this subject but programming in general:
Is there a difference in performance when doing operations with 64 bit variables vs 32 types ? And I'm not talking...
Oh yeah :) silly me.. forgot about that 1000 byte is KB. Thanks for the correction and all the help.
There is one more thing I don't understand.. if I store 823,543 structs. Each of those structs contains an array of 7 long long (64 bit) type , another 64 bit for the key, and another int (32...
Thank you all for the usefull comments. Zub , I afraid that binary search will be a little on the slow side (although the idea itself is nice) , I think I prefer using chaining search..but maybe I am...
This one is easy for you experts ;)
I want to start and organize my code better, even for small programs.
And while I got the basics from reading info from around the net,
There are still...
When initiating the table,I have a function that goes through all possible 7**7 combinations , and for each of those combinations it produces a unique 64 bit number.
so In the end, I will have...
first of all, thx again for your comments, and sorry for letting this thread slip away a little from the main subject, but this is interesting and important to me (and the main reason that I started...
I will be handling collisions with chaining. each index in the array (hash table) will hold a pointer to a node struct which will be the root of a linked list.
In fact, I need exactly 823,543...
Thx for the comment laserlight ,
This array is used as a hash table so I have no better choice.. at least nothing that I am able to think of :)
so it is ok if I allocate this global array on...
Hi all.
I have two questions:
1. As I understand , when creating a local variable inside a function it is created on the stack, and when that specific function exits this variable is gone...
Thx for the reply. so if that so, why do I see sometimes people do: long long board[2];
n[0] = 0LL;
n[1] = 0LL;
what is the purpose of that ?
Hello everybody,
I want to ask: when do i really need to use Suffix for numbers.
I will give an example:
let say I write:
[code]
long long c;
[code/]
Thx a lot :)
so doing:
int i = 4;
int j;
for(j = 0; j < 1000000; j++){
i += j*i;
}
To answer you question , I just gave an example to show what I mean (I was lazy). In my actual program (a game engine) I hold a global array of pointers, and I use them to access board indexes. ...
Hi,
This is probably been asked here before...but:
what is faster ?
this:
int main()
{
int n[] = {1,2,3,4,5,6,7,8,9,10};
Yep.. if i would wait for another minute before writing this post i would probably see it myself :). So stupid of me..
Thx for the reply anyway
The admins may remove this thread :)
Hi all,
I wanted to write a simple function to count the set bits in an integer:
int countSetBits(int bitSet){
int counter = 0;
while(bitSet > 0){
if(bitSet &...
Yeah, ofcourse I just gave those as an example. My real intention is using
enum{WHITE,BLACK}
instead of 0 and 1 in a game for example.. or
enum{FALSE,TRUE}
Yeah, I meant using a global variable (#define)
#define ZERO 0
#define TEN 10
int i;
//this is using the constants
I know it is maybe a little noobie question, But I want to know,
Is using raw number faster than reading it from a variable ? (not talking about the time it requires to initialize the variables,...
Ok thanks, I will check WxWidgets. I was asking about BGI because The first thing google finds when searching for "C graphics" Is some basic tutorials for using the BGI library (with <graphics.h>)
Hi, I am programming with code::blocks IDE for some time now and I love it. But now I want to start learning a little bit about basic 2D graphics.
I have read tutorials about how to initiate...
Hi. I have just recentely learned on function pointers.
So now i know how to create a function and assign it a pointer.
So far so good.
But can someone give me a simple example on how I can...
I have a little question regarding this..
I will give an example: let's say i have this condition
int x = 5;
if(x ==2 || x ==5 || x ==1 || x ==8 || ....){
return 1;
}