Salem_c's Profile User Rating: ****-

Reputation: 1743 Grandmaster
Group:
Mentors
Active Posts:
3,360 (2.04 per day)
Joined:
30-May 10
Profile Views:
38,089
Last Active:
User is online 37 minutes ago
Currently:
Viewing Forum: C and C++

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   Salem_c has not set their status

Posts I've Made

  1. In Topic: Prints out wrong answers

    Posted 25 Nov 2014

    You need to show us an example of your input data, actual output results, and an explanation of why you think the results are wrong. It might be the results are correct, and your interpretation is at fault.
  2. In Topic: Problem with pointer

    Posted 25 Nov 2014

    http://en.wikipedia....ki/Indent_style
    This is for line 100 onwards.

    I've no idea why you should want (or need) so many delete calls just to move.

    Yes, you need one delete call when one piece takes another piece.
    But moving should simply be
    f[newy][newx].figure = f[oldy][oldx].figure;
    f[oldy][oldx].figure = 0;
    
    

    And these lines should be encapsulated into a member function of Field, so you say
    movePiece(oldx,oldy,newx,newy);
    
    
  3. In Topic: Binary search tree inorder traversal

    Posted 25 Nov 2014

    You just replace
    cout<<nodePtr->value;

    With
    fptr(nodePtr->value);


    All you need to know on function pointers
    http://www.newty.de/fpt/
  4. In Topic: Conditional jump or move depends on uninitialised value(s)

    Posted 25 Nov 2014

    33	        //TODO: might be bad debugg to check
    34	        word[index] ='\0';
    35	         
    36	        hash_val = hash(word);
    37	 
    38	        for (int j = 0; j < index; j++)
    39	        {
    40	            new_node->word[j] = word[j];
    41	        }
    
    

    Yes you add a \0, but you still fail to copy the \0 to the destination new_node->word.
    TBH, after line 34, all you need is strcpy()
  5. In Topic: Help with C! Im trying to make my program to print out a string th

    Posted 24 Nov 2014

    > char word;
    Lets start with
    char letter; // a single letter
    char word[30]; // many letters

    Write a program that reads in a single word, and just prints out that word - as typed by the user.
    So if they typed in CamelCase
    You would print CamelCase

My Information

Member Title:
void main'ers are DOOMED
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Programming Languages:
C, C++, Perl, awk, various assemblers

Contact Information

E-mail:
Private

Comments

Page 1 of 1
  1. Photo

    fromTheSprawl Icon

    07 Sep 2012 - 02:38
    Please read my thread. I kid! Just want to say your forum avatar is awesome. ^^
  2. Photo

    Salem_c Icon

    26 Dec 2010 - 01:36
    Do not PM me for 1:1 support, or to try to get me to read your threads.
Page 1 of 1