Search:

Type: Posts; User: patishi

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds.

  1. Replies
    23
    Views
    1,917

    Btw , another question not related to this...

    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...
  2. Replies
    23
    Views
    1,917

    Oh yeah :) silly me.. forgot about that 1000...

    Oh yeah :) silly me.. forgot about that 1000 byte is KB. Thanks for the correction and all the help.
  3. Replies
    23
    Views
    1,917

    There is one more thing I don't understand.. if...

    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...
  4. Replies
    23
    Views
    1,917

    Thank you all for the usefull comments. Zub , I...

    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...
  5. Correctly defining and declaring arrays (in header and source files)

    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...
  6. Replies
    23
    Views
    1,917

    When initiating the table,I have a function that...

    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...
  7. Replies
    23
    Views
    1,917

    first of all, thx again for your comments, and...

    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...
  8. Replies
    23
    Views
    1,917

    I will be handling collisions with chaining. ...

    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...
  9. Replies
    23
    Views
    1,917

    Thx for the comment laserlight , This array is...

    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...
  10. Replies
    23
    Views
    1,917

    Little guidance in memory management

    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...
  11. Thread: Suffix use

    by patishi
    Replies
    3
    Views
    692

    Thx for the reply. so if that so, why do I see...

    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 ?
  12. Thread: Suffix use

    by patishi
    Replies
    3
    Views
    692

    Suffix use

    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/]
  13. Thx a lot :)

    Thx a lot :)
  14. so doing: int i = 4; int j; for(j = 0; j

    so doing:


    int i = 4;
    int j;
    for(j = 0; j < 1000000; j++){
    i += j*i;
    }
  15. To answer you question , I just gave an example...

    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. ...
  16. Dereferencing pointer vs local variable performance ( Another noob question :) )

    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};
  17. Replies
    14
    Views
    2,115

    Yep.. if i would wait for another minute before...

    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 :)
  18. Replies
    14
    Views
    2,115

    what's wrong with this code?

    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 &...
  19. Yeah, ofcourse I just gave those as an example. ...

    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}
  20. Yeah, I meant using a global variable (#define) ...

    Yeah, I meant using a global variable (#define)




    #define ZERO 0
    #define TEN 10

    int i;
    //this is using the constants
  21. Using raw number VS reading from a variable , what's faster?

    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,...
  22. Ok thanks, I will check WxWidgets. I was...

    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>)
  23. Need help starting with basic graphics (technial compiler related question)

    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...
  24. Replies
    2
    Views
    1,364

    Very basic OOP programming in C

    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...
  25. Question about conditional operators ( || vs |)

    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;
    }
Results 1 to 25 of 73
Page 1 of 3 1 2 3