User Profile

Collapse

Profile Sidebar

Collapse
hdanw
hdanw
Last Activity: Apr 29 '09, 02:45 AM
Joined: Feb 1 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hdanw
    replied to How to looping with Timer?
    in C
    Code:
    while(TimerFlag = 0);
    This will always fail to execute as

    Code:
    TimerFlag = 0
    will always be false.

    Code:
    if(timerId = 1)
    This line isuseless unless you actually want to assing 1 to timerId, but the braces and the if are not neccessary.

    I think you stick with the basics for now.

    You need to get with your instructor and let him or her know you need some one...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to Pointer conversion
    in C
    Here is a pointer Variable implementation of your app:

    Code:
    int MyRecursiveFunction(int n);
    
    int (*fact)(int) = MyRecursiveFunction;
    
    void main()
    {
    int num,f;
    clrscr();
    printf("\nEnter a number: ");
    scanf("%d",&num);
    f=fact(num);
    printf("\nFactorial of %d is: %d",num,f);
    getch();
    }
    int MyRecursiveFunction(int
    ...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to how to draw a dashed line in c
    in C
    A dash is made up of dots.

    Try putting your dots really close to gether for a while, then skip some space, and put them close together for another while...

    Should look somehting like this:

    ..... ..... ..... ..... ..... .....
    See more | Go to post

    Leave a comment:


  • Use the Shift Key.

    ;)
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to bitwise operation on a code more than 64 bits
    in C
    My Apologies.

    With 4 hyper and 1 comited thread, there is a fork in the loop.

    The compare: have we reached the end?

    One hyper thread must persue one path while another persues the oposing path. And you only complete roughly 3 iterations in the time it takes to do 1.
    See more | Go to post

    Leave a comment:


  • UBUNTU?

    Must have been removed...

    Doesn't everyone use windows?
    See more | Go to post

    Leave a comment:


  • May not be what you want.

    Can you Identify what the scope is on this Lock() call?

    Essentially a mutex m, is either locked, or unlocked.

    The OS core, is not selective about who acquires the mutex, when.

    So lets say that you are in a multi threaded environment, as is the case when synchronization is required, and you have a mutex, which is inherently associated with the object / instance....
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to bitwise operation on a code more than 64 bits
    in C
    In todays day and age, smaller is better.

    If you can get all of the code in to cache on the processor it will run quicker than not.

    _int64, is there for compatibilty and design of programs that may someday run on an a64 machine, however most operations on an a32 machine have to simulate behavior.

    So you are simulating it, the Compiler has generated additional code to simulate it, ...

    ...
    See more | Go to post

    Leave a comment:


  • I hate to correct you'll but...




    2 lots of ADDRESSES to 76000 characters is only 608K on x86 and 1.2Mb on an a64

    But the allocation granularity may consume more than that.
    You cannot allocate a space that is in 1 byte chunks! So pushing char instead of char * wont make much difference.


    weaknessforcats
    Moderator


    Is not intirely correct....
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to Mixing Pointers and Integers in C
    in C
    Pointers and integers are different sizes, types.

    On some compilers you can do integer arithmetic on pointers to get some calculated offsets, but this is not a good practice to get into, as your code becomes less maintainable, and less portable.

    Try to write things so that the compiler can understand what you are doing. Then your code will work properly.

    For example :

    Using a pointer to...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to c++ programme for loan adviser
    in C
    You might as well get used to the fact that your teacher is not going to tell you what you need to know to do your job.

    Thats not what they are there for.

    You have been shown how to implement a number of methodologies that are used on computers.

    It is your job function, your responsibility to figure out how to put all of the tools together to meet your end goal.

    I am more than happy to do...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to freelance website
    Are you asking if I feel you have the qualifications to make a good career out of freelancing?

    I have no idea.

    Here are a few things you will find out, though if you do morew than ask other people and actually find out for yourself.

    - People who hire freelancers expect a lot for less money. You can make more money, steadily by working for a firm.
    - Serious companies seldom hire freelancers, as...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to Ambiguity issue
    in C
    George,

    Go back and read everything I posted.

    There is a very good c++ explination, and the answer to your question can be found there.

    Good Luck,

    Dan -
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to CHALLENGE: Implement a DFA
    Been there, done that.

    Also : Discrete Finite Automaton.


    The quickest and most straight forward method is to build a 2D array of function pointers.

    When you get an event that changes state, you update the current state funtion Pointer to the function indexed by the 2d array.

    This is very quick, and works well with windows.

    IE : the rows would be one for each state,...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to extern "C"
    in C
    Use the extern keyword so that they can be linked outside of its normal frame of reference.

    The "c" tells the compiler how to push information on the stack.

    The keyword should be added to the Definition of functions, so they can be called by other files.

    And declaring extern on a declaration means that the actual declaration exists outside of this file. And should be visible to all linked...
    See more | Go to post

    Leave a comment:


  • [qoute]
    int find_transpose( int n, double **a, double **b)
    {
    int i,j;
    for (i=0; i<n; i++)
    {
    for (j=0; j<n; j++)
    b[i][j] = a[i][j];
    }
    for (i=0; i<n; i++)
    {
    for (j=0; j<n; j++)
    b[i][j] = a[j][i];
    }
    }
    [/qoute]
    Did you compile this?
    The first loop is useless, the intire...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to Basic Array Problem
    in C
    Vectors are slow, Arrays are built more directly into machine code. Thats why.

    Also C++ is a superset of C. This means it IS C, and (++) so much more.
    See more | Go to post

    Leave a comment:


  • Every time I've had this problem it is with a definition in an hpp include file.

    Definition, not declaration.

    If you include the same file twice, directly or indirectly then you have effectively typed everything into the same file twice.

    Try using the once keyword. This instructs the compiler to include the file once and no more.
    Code:
    // header.h
    #pragma once
    ....
    ...
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to css 2 backgrounds
    When you specify a width and hieght you are telling the browser that something exists at point x, y.

    The scrool bar is there so you can find the content you said was there.

    Try taking your hieght and width completely out of the CSS file completely and let the picture run at its normal attitude.
    See more | Go to post

    Leave a comment:


  • hdanw
    replied to Ambiguity issue
    in C
    You need to understand the at run time a pointer is just that, but at compile time the pointer is 1- a pointer with size and location, and 2 - pointer to Something.

    The type information exists so that the compiler can do a number of things that they normally wouldn't.

    For example.

    Code:
    struct somestruct
    {
        int x, y, z;
        float a, b;
    }
    somestruct mytable[64];
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...