AmitTheInfinity's Profile User Rating: *****

Reputation: 119 Stalwart
Group:
Authors
Active Posts:
1,563 (0.55 per day)
Joined:
25-January 07
Profile Views:
13,574
Last Active:
User is offline Nov 11 2014 09:34 PM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Who Cares
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Who Cares
Dream Kudos:
125

Latest Visitors

Icon   AmitTheInfinity Love to code, live to code

Posts I've Made

  1. In Topic: Program is Crashing, New User, Need Help

    Posted 30 Oct 2014

    Check line 50 again. You are sending judgeTotal with an ampersand there. Now check how you sent parameter highestScore when you called function findHighest. That's the difference I am talking about.

    When you send a parameter with ampersand, it means that you are actually sending address of that variable. That's why system is assuming that function must be having a pointer to take this value (a double *) where as your function declaration says that parameter is a double variable reference. That's why you are getting that error.

    Ampersand in signature of function definition or declaration is a different thing. That makes sure that parameter is a reference to variable.
  2. In Topic: Program is Crashing, New User, Need Help

    Posted 30 Oct 2014

    This is how you have defined your function after main (Line 221) :
    double calcScore(double score1, double score2, double score3, double score4, double score5, double lowestScore, double highestScore, double &judgeTotal)
    Which looks correct...

    This is how you called it (Line 50) :
    calcScore(score1, score2, score3, score4, score5, lowestScore, highestScore, &judgeTotal);
    Now here again compare this call with your findHighest function call. Are you treating judgeTotal exactly how you treated highestScore? check that difference.

    BUT your declaration above main is (Line 12):
    double calcScore(double &score1, double &score2, double &score3, double &score4, double &score5, double lowestScore, double highestScore, static double judgeTotal);
    Missed to change something here?
  3. In Topic: Program is Crashing, New User, Need Help

    Posted 30 Oct 2014

    Code please...

    Always make sure when you post some error, post code that gives this error as well. Even if it's just a 2-3 line change in your code.
  4. In Topic: Program is Crashing, New User, Need Help

    Posted 30 Oct 2014

    Instead of using static here for judgeTotal:
    double calcScore(double &score1, double &score2, double &score3, double &score4, double &score5, double lowestScore, double highestScore, static double judgeTotal);

    Treat it in a similar way you treated highestScore here:
    double findHighest(double &highestScore, double score1, double score2, double score3, double score4, double score5);

    Which means only judgeTotal should be reference not all your score variables in calcScore.
  5. In Topic: Can you guys see what's wrong w/my Malloc (using pointers to struc

    Posted 1 Jun 2014

    malloc returns void pointer, you have to explicitly typecast it to Employee structure pointer.

    Also, you already have an array declare in main, I could not understand why you are allocating dynamic memory and then assigning that to array again. empArray[i] = emp;

    Either have block of dynamically allocated employee structures or have an array. Don't mix them.

My Information

Member Title:
C Surfing ∞
Age:
Age Unknown
Birthday:
June 24
Gender:
Years Programming:
9
Programming Languages:
C, C++, Java, J2EE, J2ME, .NET, PHP

Contact Information

E-mail:
Private
Website URL:
Website URL  http://
LinkedIn:
http://www.linkedin.com/in/patilamit
Twitter:
amittheinfinity

Friends

Comments

Page 1 of 1
  1. Photo

    Lawlzes Icon

    30 Oct 2014 - 15:33
    He is awesome, took the time to explain code to me, even though I don't know much! Thank you!
  2. Photo

    HYK Icon

    13 Apr 2013 - 01:24
    Hi,,,,,I have graduation project in PHP using Drupal CMS, even now I couldn't find anyone who help me, I work on Airline reservation System, I stoped on reservation operation, Little time remaining please can help me
  3. Photo

    weblevi Icon

    22 Nov 2011 - 23:57
    Me and my group need to turn this in in 12 hours:
    Implement a C program that reads a string and prints a table with the number of occurrences of each character in the string. Ex: Rubber. r = 2, u = 1, b = 2, e = 1.
    If you could save us in this one I would be very grateful! my e-mail is: levi_web@yahoo.com
  4. Photo

    weblevi Icon

    22 Nov 2011 - 23:35
    Hey man I need some help with a program, i've been up all night and i can't figure it out can u give me a hand?
Page 1 of 1