#define's Profile User Rating: *****

Reputation: 1617 Grandmaster
Active Posts:
5,681 (2.34 per day)
19-February 09
Profile Views:
Last Active:
User is offline Oct 10 2015 06:52 PM

Previous Fields

Who Cares
OS Preference:
Favorite Browser:
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Your Car:
Dream Kudos:
Expert In:

Latest Visitors

Icon   #define has not set their status

Posts I've Made

  1. In Topic: need help with code for hmwk

    Posted 10 Oct 2015

    Hi, scanf leaves a newline in the stream. You seem to be aware of that but not handling all the newlines.

    The first scanf reads a number and leaves a newline in the stream. The second scanf reads the newline as a character.

    When you think you are entering the type of service, you are at the third scanf which wants a number, when a character is input the stream fails and then the other scanfs don't try to read from the failed stream.

    You don't need dummy scanf's to read the enter character, put a space before the format parameter and any whitespace including will be ignored.

      scanf_s(" %c",&neg); // <- space in format string
  2. In Topic: Airline Reservation System Help

    Posted 8 Oct 2015

    Hi, MAX_ROW and MAX_SEAT are constants so don't change in value. Capital letters are usually used for constants.

    You can use them to size the array.

    const int MAX_ROW  = 7;
    const int MAX_SEAT = 4;
    char seatArray[MAX_ROW][MAX_SEAT];

    Here you create MAX_ROW and MAX_SEAT variables locally, which are different from the constants above.
    To be less confusing you can use lowercase variables, so there is no conflict with the constant values.

    void initializeArray(char seatArray[MAX_ROW][MAX_SEAT]) {
      for (int row = 0; row < MAX_ROW; row++) {
        for (int seat = 0; seat < MAX_SEAT; seat++) {
          seatArray[row][seat] = 'A' + seat;

    The equality operator is == not = assign.

      if (MAX_SEAT = 1)
        seatArray[MAX_ROW][MAX_SEAT] = 'B';
      if (MAX_SEAT = 2)
        seatArray[MAX_ROW][MAX_SEAT] = 'C';
      if (MAX_SEAT = 3)
        seatArray[MAX_ROW][MAX_SEAT] = 'D';
  3. In Topic: Estimating Pi Program?

    Posted 8 Oct 2015

    The variables term and t should be the same variable, as well as sum and s.

    When multiplying the * operator is used.

    pi = 2 * s;
  4. In Topic: Address book - linked list C++

    Posted 8 Oct 2015

    Hi, this is C++ I presume, so you don't need to use printf or include stdio.h. You can use cout instead.

    Basic Input/Output

    The node is the part/object that holds the data. In your code it only holds a character - you most likely want a character sequence.

  5. In Topic: Need Help w/ sort of BinaryTree

    Posted 7 Oct 2015

    Your are trying to use the insert function but you are not always wanting to create a new node. You could write a new function that updates the tree, if it cannot update the tree it would use insert to add another node.

    The node structure could have an add/append function to add to the value. Perhaps a get key function as well. It might be simpler to use a vector for the node value.

My Information

Member Title:
Duke of Err
Age Unknown
Birthday Unknown
Delta Quadrant
Years Programming:
Programming Languages:

Contact Information

Website URL:
Website URL  http://


Page 1 of 1
  1. Photo

    moonlight1020 Icon

    07 Jul 2015 - 11:15
  2. Photo

    mireille4U Icon

    30 Apr 2015 - 05:44
    Greeting from mireille i saw your profile today and i became interested in you and i will like to know more about you and if you can mail an email to my mail address (mireille4u@live.com) i will give you my picture.here is my mail address i hope we can move from here.above. Mireille
  3. Photo

    GryphonClaws Icon

    10 Jan 2013 - 01:15
    Thanks #define. I can't believe I missed such a simple detail.
  4. Photo

    raghav.naganathan Icon

    07 Nov 2012 - 20:40
    Dude...before your reputation changes, I would like to tell you that it(729) is a perfect cube :) Cheers :)
Page 1 of 1