Yes I realized that..I've already modified my code. Thanks!
Type: Posts; User: black_stallion
Yes I realized that..I've already modified my code. Thanks!
Okay I see..Thanx!:)
Might be? Does that mean this copy is sometimes deleted and sometimes not(and thereby wasting memory if I make such repeated calls)?
Consider the following class.
class complex
{
private:
int r,i;
public:
complex operator + (complex c2)
{
Thanks a ton! Indeed the debugger set its value to 0 explicitly.!:D Just about everything other than that variable had been initialized. Amusing how just one glitch can affect a program's output!
I have a code to convert a number to words(e.g. 31415-->Thirty one thousand four hundred fifteen) The code compiles with no errors/warnings and outputs correctly when debugging. But nothing happens...
Okay, I tried rewriting this piece of code with getchar in the while loop to manually end the loop with EOF(Ctrl+Z)(I'm using Windows) It worked.
However, any reasons as to why this doesn't work?...
Hi! Here's my code for addition of two sparse matrices represented as a 3-tuple. The program adds up all elements in sparse matrices A and B and stores it in matrix C except that it repeats some...
Anyway found my mistake. While exiting the for loop, movinghead became equal to NULL. So in the next loop, any reference to movinghead resulted in the compiler trying to access a NULL address...
I don't see anything wrong with that. It's not like I disrespect people's valuable feedback and opinions; its just that I sometimes like to have more than one viewpoints on a particular problem....
The first loop ends as soon as movinghead becomes NULL(which is the case for the last node in the list) By my logic, at this time, movinghead now points to the last element in the list. All I have...
It prints the elements of the list entered properly. But it doesn't print them in the reverse order as expected from the code starting at line 56. How should I modify it to print them in reverse?(if...
Here's a very primitive code for a doubly linked list. Although its only very rudimentary, whats wrong with this code? the code's supposed to print the elements sequentially starting from the first...
Ah you hit the nail on the head! Sometimes you just think so deep that you overlook the simpler things! That's why I saw a few anomalies while watching values of left,right,i,j,to name a few!...
Hi! I've been studying quick sort. I stumbled across this piece of code:
void quicksort(int arr[], int left, int right) {
int i = left, j = right;
int tmp;
int pivot =...
No! I'm sure I didn't even touch anything else apart from changing float to int for that variable.(I mean, I 've tried doing every permutation to get to the bottom of this when I finally came at this...
I've found the problem. The float variable per is the problem. Replacing the type float in the structure with an int resolves the problem though I have no idea why this is so!
Whoa Whoa! I expected some educated answers; not condemnation for trying to learn C! I accepted that my code was not at all good, didn't I? But I only requested for some error to be pointed out to me...
Alright..I understand that my code is not so efficient(may be not at all). But shouldn't it give me the same result?(regardless how concise my code is) Could you point out any error in my code so I...
Okay now I get what was implied by a 'comparator'. But how about swapping? How would you integrate a swapping routine with a comparator code(with respect to my program)?
Sorry! Was new to the site so thought of coloring when I later found out about the code tag and then forgot to de-colorize the program!
Okay I got the part about main.
Could you be more specific?...
Hi alll!
I've created this C program(see attachments please) to accept names, roll numbers and percentages of 6 students. I've created an array of 6 structs each comprising above mentioned...