thats tabstop, that makes sense. I have one last question Im stumped on. Im trying to calculate the number of white pixels per row, but so far I can only get it calculate the total number of white...
Type: Posts; User: wankel
thats tabstop, that makes sense. I have one last question Im stumped on. Im trying to calculate the number of white pixels per row, but so far I can only get it calculate the total number of white...
Hi, Im trying to initialize the counter array to all zeros, but I keep getting this error when trying to compile:
xray.cpp:30: error: variable-sized object ‘counter’ may not be initialized
...
Thanks for the help and advice everyone! I finally got everything working nicely, but there is one last thing I would like some help on.
At the end of "test.cpp", how do I make z.display() the...
thanks tabstop. I made your change and both the fraction.cpp and fractiontest.cpp compile fine individually. But when I try to combine them using the following line on linux:
g++ -Wall -ggdb...
thanks for the help guys!
changing it to "z = x.add(x, y);" worked. However, when I removed the second parameter, I get a compiling error:
mixedfractiontest.cpp:17: error: no matching function...
Hello everyone, Im writing a fraction program that will do some nifty stuff. To cut to the chase, here are my 3 files but Im having trouble compiling the test function, i keep getting a "no match for...
Thanks for detailed help guys :)
Crap. there was a true false question about binary searches on the exam that said something along the lines of "on average the number of attempts the algorithm...
thank you sir, youve been very helpful :)
Alpha Bravo Charlie |Echo| Foxtrot Golf Hotel
Alpha |Bravo| Charlie
Alpha |Charlie|
why Charlie and not Alpha at the end? or could either one have worked?
I thought it would go in alphabetical order, so my answer would have been alpha, brave, charlie, then echo.
Im looking over the practice exam our professor put up, and Im having a hard time understanding one of the problems. It goes like this:
Given the following array of character strings,
char...
a and c are used to calculate the distance. Its the formula I found online. Ill take another look and see if I can find the issue.
Im wrapping this up and all I have left is sort by distance part. I wrote the code but its not giving me the output Im looking for. It doesnt seem to be doing anything.
//sort by distance...
I feel so dumb. I added the y's to the printf statement and everything is showing up as it should.
#include <stdio.h>
void read_location(double *x, double *y);
int main ()
{
struct coord{
double x;
double y;
};
will "struct coord hold;" do the trick? Im currently using that right now and its giving me the same error so I think im doing it wrong haha
EDIT: nevermind, that worked :)
But when I sort the...
Im assuming this isnt as easy as just writing "struct hold;"?
Im still getting errors for the swap part:
hold=array[a];
array[a] = array[a+1];
array[a+1]=hold;
Im getting this error when I remove the ".x"
My issue is that I will have to sort them by the y's as well. So if I swap the entire struct, will i still be able to sort the y's later on? And to swap the struct, i just remove the ".x" right?
Thanks Adak, I couldnt have done it without you guys :) I have one very last question. I wrote a sorting program that will sort the x's and y's in ascending order:
int pass;
int a;
int hold;...
Im using a gcc compiler on linux. Could you explain the whole void instead of int thing? Im not finding the info I need on google. They both seem to work fine in this code, is there any advantage to...
Heres what I have after all your wonderful advice. Everythings works awesome, thanks everyone, time to move on to sorting and all that fun stuff :)
#include <stdio.h>
//function prototype...
I rewrote the program since I lost track of what I was doing the first time, heres what i have now:
#include <stdio.h>
struct coord{
double x;
double y;
};
I forgot to say, if I have it without the "&", it just displays a "1" every time, no matter what number i choose to enter.