Search:

Type: Posts; User: bigtamscot

Page 1 of 11 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    8
    Views
    30,066

    When trying to get the highest and lowest values...

    When trying to get the highest and lowest values for an array of integers, it is a good idea to set the values of high and low prior to the loop where the minimum is the highest value possible and...
  2. Replies
    8
    Views
    30,066

    In C all arrays are passed by reference, that is...

    In C all arrays are passed by reference, that is the variable is the address of the first element of the array. The trouble you may be having in the second program which uses pointer notation is with...
  3. Replies
    27
    Views
    2,859

    Look at where your semi colons are. for...

    Look at where your semi colons are.



    for (i=0; i < 9; ++i);
    for (j=0; i < 19; ++j);
    nums[i][j] = 2*i;


    if you are just starting out in C then think on what putting semi-colons at the...
  4. Replies
    3
    Views
    1,262

    check the FAQ's before posting, maybe then you...

    check the FAQ's before posting, maybe then you may find the answer without feeling stupid.

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385
  5. Replies
    4
    Views
    1,556

    beaten by pianorain :)

    beaten by pianorain :)
  6. Replies
    4
    Views
    1,556

    srand() is used to ensure that everytime you run...

    srand() is used to ensure that everytime you run the program that the numbers generated will be unique each run (in theory). rand() is used to generate the random number.
    Have a look at the...
  7. Thread: C# and C++

    by bigtamscot
    Replies
    7
    Views
    1,786

    Have a look at what employers are asking for...

    Have a look at what employers are asking for nowadays by going to any reputable job site :)
  8. Replies
    3
    Views
    1,067

    Your best bet would be to get a compiler that is...

    Your best bet would be to get a compiler that is C complient and allows you to run C programs with a C compiler...Have a look here for DevC++...
    http://www.bloodshed.net/
  9. Replies
    3
    Views
    2,033

    this depends on which compiler you are using. You...

    this depends on which compiler you are using. You refer to VB so I take it your using VS.NET. I can only guess that it would be the same way as doing it in VS with VB. Forget that, your best bet...
  10. Replies
    2
    Views
    7,822

    First of...you can't initialize your array of...

    First of...you can't initialize your array of TDirections directly, you will have to do it each element at a time...


    // Directions for N, NE, E, SE, S, SW, W, NW, assumming North and West are...
  11. Replies
    7
    Views
    1,562

    try google......

    try google...
    http://www.google.co.uk/search?hl=en&q=c%2B%2B+and+databases&btnG=Google+Search&meta=
  12. So you dont want to attempt it yourself. How do...

    So you dont want to attempt it yourself. How do you think you would go about using a menu. After all it is a selection process and in your case involves characters...


    cout << "Shall I answer...
  13. Replies
    28
    Views
    3,540

    to use strcat you have to pass two array of...

    to use strcat you have to pass two array of character parameters. Your second parameter in your strcat call seems to be a single character to me. What you trying to acheive here. If you need to...
  14. Replies
    8
    Views
    3,470

    get rid of the chevrons in your own header files....

    get rid of the chevrons in your own header files. They should also be in the same directory as your main file.

    #include <stdio.h> // adds a library to program or header
    #include "myheader.h" //...
  15. Replies
    10
    Views
    1,611

    Also you declare tmp as a character array to hold...

    Also you declare tmp as a character array to hold 100 elements (100 bytes of memory) and then read a file at 200 bytes. Just asking for trouble.
  16. Replies
    10
    Views
    1,611

    do { fgets(tmp,200,fPtr); ...

    do
    {
    fgets(tmp,200,fPtr);
    sscanf(tmp, "%d %s %f %d", &records[i].id, &records[i].name, &records[i].pr, &records[i].csalary);
    }


    you do not increment (i) in the...
  17. Replies
    10
    Views
    1,611

    Sorry your coding seems all C but you include the...

    Sorry your coding seems all C but you include the C++ specific header files and using namespace std.
  18. Replies
    10
    Views
    1,611

    Bet your wondering why no-one is replying. ...

    Bet your wondering why no-one is replying.

    Have a look at which forum this is. :)

    Try the C++ forum.
  19. cant remember ever reading Beginning C++, now...

    cant remember ever reading Beginning C++, now Beginning C yes, but cant remember last time I picked it up though. :)
  20. int rand_in_range( int hi, int lo ) { ...

    int rand_in_range( int hi, int lo ) {
    srand(time(NULL));

    return ((rand() % (hi - lo)) + lo);
    }
  21. You have a hi and lo number, // subtract lo...

    You have a hi and lo number,


    // subtract lo from hi (80 - 20 = 60)
    // generate number in range up to difference (60)
    random_num = rand() % (hi - lo);

    // then just add the lo
    random_num +=...
  22. Replies
    4
    Views
    1,126

    Yes if you set it up right. // in...

    Yes if you set it up right.



    // in complex.h
    friend istream& operator>>(istream &input, Complex &c);

    // in your cpp file
    istream& operator>>(istream &input, Complex &c)
    {
  23. Replies
    4
    Views
    1,126

    An example of the operator overload of the input...

    An example of the operator overload of the input istream operator.


    // declaration in class file
    friend istream &operator>>( istream &, Tester & );

    // member defintion in cpp file
    // i and j...
  24. Replies
    8
    Views
    1,640

    try it out then :) This maybe compiler specific,...

    try it out then :) This maybe compiler specific, but if I remember correctly, setting the first elements to null will set the remaining elements to null on BB5.
  25. Replies
    8
    Views
    1,640

    if ( sex == m ) { cout

    if ( sex == m ) {
    cout << "GO AWAY!!!" << endl;
    }
    else if ( sex == f ) {
    cout << "Hey Baby ;).... call me!! " << endl;


    You are trying to compare the input (sex) from the user for the...
Results 1 to 25 of 252
Page 1 of 11 1 2 3 4