Alright, nevermind, it seems to be working. I'm still wondering how it read the other program. I did everything the same but this time it gave me the averages (which are 13 and 3.08, by the way)
I...
Type: Posts; User: Ryan0773
Alright, nevermind, it seems to be working. I'm still wondering how it read the other program. I did everything the same but this time it gave me the averages (which are 13 and 3.08, by the way)
I...
...which "above code", the average one?
umm...Like everyone else? I think? I write the code and then press the "Compile & Run" button. Is there another way to compile it? This hasn't ever happenned before with my other projects.
Well whenever i run it, instead of running this code, it runs my multiplication code:
#include <iostream>
using namespace std;
int mult (int x, int y);
This is the code that i am having trouble with. it says the problem at the end of the quote.
...Ya i have no idea what you guys are saying so that might meen that im a bit confused
You code works, it gives me the average of the number, but im just wondering how my code
----ed up so...
I tried them both out but they didn't seem to work, i may be doing something wrong but that doesn't really matter right now, ill learn it later I'm just friggin confused with this. When i input this...
I have been trying to loop a switch case code so that when the default is activated, it loops back to the begginning of the switch case. Unfortunately, when i tried to construct a loop that would do...
Alright, i get it, thanks!
I still dont understand why we make x = 42 in the first place and i still dont know what happens to the 42
Just one more thing. In the binky video it shows how a pointer works. but when it makes y point to the same thing as x using this:
int* x;
int* y;
x = new int;
*x = 42;
y = x;
*y = 13;
ok thanks, I'm really sorry i got ticked at you, i thought that i ahd fixed the problems but i overlooked them, hehe,twice. Anyways thanks for the help!!!
I agree with you 100%, only problem...
srry, forgot to fix that should be:
#include <iostream>
using namespace std;
int main()
{
But is my code correct now?
#include <iostream>
using namespace std;
int main()
{
If you had read the other threads you would have noticed that laserlight had corrected me on the p = &x. I added the p = 0 because the tutorials said that making it a null pointer was a good idea....
I dont need any slack, he wrote the exact same code that i had before! he told me that i needed to do something to delete, but the delete that i had was in the right place so i thought he meant...
THATS EXACLTY WHAT I WROTE BEFORE!!!!!! (well not when i showed the "previouse code", i made a mistake, i forgot to take out the p = &x) I wrote that in my code then you sayd that i wrote it wrongand...
ao my previous code was alot better... Then what needs to be fixed???!!!
(Previouse code)
#include <iostream>
using namespace std;
int main()
The added delete doesn't really seem to have any effect with the outcome but i guesse it's better safe then sorry. Thanks for the tip. So something like this?
int i(25 + 4);
int x(4);
...
i was just wondering how to add body to a code, like how could i add body to a switch case like this:
int input;
int* p; //not sure if the pointer would en up looping it but...
When would the i variable be destroyed. would it be destroyed when p was assigned to a new variable?
In the code though the first one needs to be there right? where it says:
p = &i;
Does that need to be there or would thta delete the i later?
So the pointer makes the program find the class with the 3d object and instead of the program copying the entire script of the object, using up thousands of bytes, the program gets the information...
it doesn't seem to be a major mistake but i guess it would save some time (or is it a big mistake?)
Thanks again for your help!
I still dont really understand what you mean by cheap, is it less...
#include <iostream>
using namespace std;
int main()
{
int i(25 + 4);
int x(4);
int *p;
p = &i;