Reputation: 119 Stalwart
- Active Posts:
- 1,584 (0.48 per day)
- 25-January 07
- Profile Views:
- Last Active:
- Mar 02 2015 11:00 PM
- OS Preference:
- Who Cares
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 4 Dec 2014
Quotepointer to the last node
You are talking about a pointer to node. It doesn't matter whether it's a doubly linked list or not. It's a circular one with pointer to a node (as Salem_c said no node is last when you are in circular list). You can traverse with single pointer pointing to node.
Posted 2 Dec 2014This is my primary analysis from what I have seen in your code (It would have helped more if you put entire code)
As you are doing this memcpy(s,strInput,sizeToCopy+1);. And s is s = va_arg(argp, char *); a pointer that points to some string you sent in variable list to your function void scanfCustom(const char* input, FILE *inputSteam, va_list argp).
Program might crash whenever your input string size (in getline) is larger than your string from variable list, as it goes beyond allocated memory for string from your variable va_list.
Posted 30 Oct 2014Check 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.
Posted 30 Oct 2014This 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?
Posted 30 Oct 2014Code 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.
- Member Title:
- C Surfing ∞
- Age Unknown
- June 24
- Years Programming:
- Programming Languages:
- C, C++, Java, J2EE, J2ME, .NET, PHP
- Website URL: