User Profile

Collapse

Profile Sidebar

Collapse
coolsmaster
coolsmaster
Last Activity: Mar 31 '07, 01:54 AM
Joined: Mar 16 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • coolsmaster
    replied to Order of error detection
    in C
    I used Visual Studio's debug feature to walk through the code line by line.

    when I input

    "updatemark 123456789 10 f9"

    after cin >> a; it will strcmp to updatemark and then cin >> b >> idx >> mark;
    then it will jump back to cin >> a; and produce "the arguement is not a number" because the value of a was alter to a unknown digit.

    I...
    See more | Go to post

    Leave a comment:


  • coolsmaster
    started a topic Order of error detection
    in C

    Order of error detection

    When I put my code through different inputs, one form of input results in a problem. when I enter:

    updatename 123456789 10 f9

    the expected output is

    "Error: 10 is out of the range 0-4"

    whereas I got

    "Error: argument is not a number"

    i tried moving the error detection around and it wouldn't work. Seem like a simple problem but I can find...
    See more | Go to post

  • coolsmaster
    replied to searching an array
    in C
    I kind of understand what you mean by this, but I have trouble converting this idea into code. Can you show me a simple representation of this in code?
    See more | Go to post

    Leave a comment:


  • coolsmaster
    replied to searching an array
    in C
    corrsponding to my code, where would I place this 2d array?
    See more | Go to post

    Leave a comment:


  • coolsmaster
    replied to searching an array
    in C
    I actually know how to use classes and structs but this project doesn't allow classes:(
    See more | Go to post

    Leave a comment:


  • coolsmaster
    replied to searching an array
    in C
    haven't learn struct neither :(

    can you do this with an array?
    See more | Go to post

    Leave a comment:


  • coolsmaster
    replied to searching an array
    in C
    I am not able to use classes though:S is the an easier way to implement this??
    See more | Go to post

    Leave a comment:


  • coolsmaster
    replied to searching an array
    in C
    well for example. in a 8x8 array i have pieces such as

    king (3,4)
    queen(1,2)
    rook(2,3)
    x(4,4)

    from the code i have above, I am able to input these pieces into the array. But now I have to see if those piece will be able to move to (4,4) which is X's position based on each piece's limitations.
    See more | Go to post

    Leave a comment:


  • coolsmaster
    started a topic searching an array
    in C

    searching an array

    I have to write a program that simulates chess such that a chess piece X is located in a 2D array and other pieces are tested if they are capable of moving to X's position.

    Code:
       int board[8][8];
       char command[200], code, charwidth[2], charheight[2];
    
       scanf("%s", command);
    
       char *ptr = command;
    
       for(int a = 0; a < 8; a++)
       {
    ...
    See more | Go to post
No activity results to display
Show More
Working...