Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. KarlSciberras

    Declaring parameters in function header

    THANKS !
  2. KarlSciberras

    Declaring parameters in function header

    Note the following piece of code: int func (myval) int myval; { //statements... } The code below, seems to me the equivalent: int func (int myval) { //statements... } My questions are: 1. What is the difference between the two pieces of code ? 2. Are there any advantages...
  3. KarlSciberras

    Borland random() function

    James, Yes, that would have been a good case. It's acually part of an algorithm used to draw a random graphic. The random function in this case determines on which axis a certain part of the graphic will be drawn. In fact a problem is that the chances of each outcome are not equally...
  4. KarlSciberras

    Borland random() function

    2ffat, Our results are very similar. When using random(100) > 50 the chances of each outcome are equally spread between "positive" and "negative" numbers. Meaning that sometimes the positive outcome slightly surpasses the negative outcome and vice verca. Please note the following fault in...
  5. KarlSciberras

    Borland random() function

    tsh73, I think you meant that -1 has approximately 70% probability while 1 has approximately 30% probability. 2ffat has shown a piece of code which I think demostrates this. Regarding the parameter passed to random: As itsgsd pointed out, it defines the range. e.g. random(5) will give...
  6. KarlSciberras

    Borland random() function

    The following is a small program which generates random numbers which can be either 1 or -1: #include <stdlib.h> #include <stdio.h> #include <time.h> int main(void) { int i; randomize(); printf("Ten random numbers of either -1 or 1\n\n"); for(i=0; i<10; i++)...
  7. KarlSciberras

    Splitting classes in .h files and .cpp files.

    After reading all your suggestions, I came up with the following code. I created another class called studentCls which is basically an array of the student class created previously. It also includes some other functions to populate the array and display them. I split the code as shown below...
  8. KarlSciberras

    Splitting classes in .h files and .cpp files.

    Thanks to all of you guys :) I will be trying your suggestions out, this is some really valuable help, Cheers.
  9. KarlSciberras

    Splitting classes in .h files and .cpp files.

    Lately I have been experimenting with splitting classes in header files and cpp files. As far as I knew, the basic concept when splitting classes in header files and cpp files was the following: header file --> declaration of class cpp files --> implimentation / definition of class However...

Part and Inventory Search

Back
Top