vividexstance's Profile User Rating: *****

Reputation: 681 Enlightened
Group:
Expert
Active Posts:
2,366 (1.66 per day)
Joined:
31-December 10
Profile Views:
12,646
Last Active:
User is offline Yesterday, 09:35 AM
Currently:
Offline

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
Expert In:
C/C++

Latest Visitors

Icon   vividexstance has not set their status

Posts I've Made

  1. In Topic: Project help with array and pointer

    Posted 27 Nov 2014

    The answer variable is an array, so you need to use it as an array by indexing into the array. I'm not even sure if you need to use an array here.

    Checking the answer like this:
    if (*(answer+10))
    

    When answer is an array, is incorrect. What it's actually doing is indexing the 10th element in the array and checking if it's value is zero or not. You want to be checking if the first element in the array equals 10, there is no comparison operators being used here at all.
  2. In Topic: [-fpermissive] error in eclipse

    Posted 27 Nov 2014

    You only put the default argument in the declaration not in the definition. So just get rid of the = 5 in the .cpp file.

    EDIT:
    The -fpermissive would just allow the compiler to continue, it's not the actual error.
  3. In Topic: Help with return value

    Posted 26 Nov 2014

    From looking at your code, you need to read up on boolean algebra as it pertains to C. You could really shorten your function down a little because you're repeating checks that have already been made:
    char andd( char operand1, char operand2)
    {
         char result=invalid;
         if (operand1 == preferred) {
               if (operand2 == preferred) {
                     result = preferred;
               }
               else if(operand2 == other) {
                     result = other;
               }
         }
    /*     if (operand1 == preferred) {
               if (operand2 == other) {
                     result = other;
               }
         }*/
         if (operand1 == other) {
               if (operand2 == preferred) {
                     result = other;
               }
               else if(operand2 == other) {
                     result = other;
               }
         }
    /*     if (operand1 == other) {
               if (operand2 == other) {
                     result = other;
               }
         }*/
    }
    
    

    Do you see how I commented out those if-statements and put them inside the other if-statements as else ifs?
  4. In Topic: How to recreate this header file?

    Posted 26 Nov 2014

    It sounds like you're just going to have to rewrite it. If you did it once, it shouldn't be that hard to do it again.
  5. In Topic: what is the problem in this programme ?

    Posted 22 Nov 2014

    Get rid of the '\n' in your prompt for a letter and see if that fixes anything.

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Comments

Page 1 of 1
  1. Photo

    orihotomihsah Icon

    09 Sep 2013 - 09:45
    Hi
Page 1 of 1