Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Drahgon

Pages: [1]
1
C - C++ / Re: Need to store an array number with its respective value
« on: December 22, 2015, 03:51:02 am »
You can make another array with indexes, and when you switch the values of your first array when sorting, switch the values of that other array also.
Cool thanks i'll give that a go :)

2
C - C++ / Re: Need to store an array number with its respective value
« on: December 22, 2015, 03:05:33 am »
Can you please elaborate more on what your problem is? I don't quiet understand what you are asking.

From what I can tell, it seems like you are asking us to sort an array and then print out the corresponding indices that they were in the unsorted array. Is that correct?

Also, the image you posted is improperly constructed.

Sorry, yes that is what I mean :) I have sorted the array correctly but I need to attach the value of {i} that the number was originally stored in. So for example if you have 10 numbers, the 4th number was 6 and so was the 3rd largest .. and the 7th was 5 an and so was the 4th largest .. I would want to output Person 4: 6 .. Person 7: 5 etc

3
C - C++ / Need to store an array number with its respective value
« on: December 22, 2015, 12:10:38 am »
Problem:



I can order the numbers .. however I can't seem to find a way to output the ordered values with their respective values in the array that they are originally stored.

Seems almost impossible to me unless there is an inbuilt function that allows you to do it.

4
C - C++ / Re: Ordering Numbers into Ascending Order
« on: December 19, 2015, 07:59:47 pm »
Basically, the for loops work by increasing the given value while given condition is true. So, your condition being i<10, when i reaches 10, the loop stops. So, as I said, after the first loop, that is the value of i.

Most commonly, the initial value is declared when you call the loop, eg.
Code: [Select]
for(x=1; x<=10; x++)Take a look at this: http://www.tutorialspoint.com/cplusplus/cpp_for_loop.htm

I still feel that you're getting ahead of yourself, I suggest you again to try to actually understand how basic stuff works before trying to do stuff.

So I finally got it to work ! Thanks for all the help

5
C - C++ / Re: Ordering Numbers into Ascending Order
« on: December 19, 2015, 02:21:57 am »
In all yoooour looooops, you never declare a starting value for you palceholders come on, really? Get to work boy.

And next time, don't use images, post the code here, i care less now above your BBcode coloring but do post it.

As I said to the post above, I declared the value within main's scope. Not sure why i have to declare it locally.

6
C - C++ / Re: Ordering Numbers into Ascending Order
« on: December 19, 2015, 02:20:32 am »
Hello again.

Glad to see your progress.

Your problem is in your for loops, you don't declare starting value for i. After the first loop, i has a value of 10, so other two loops don't even start.

Thanks, its been going well(ish). I see ok .. but I declare that starts from 0 at the top ? Do I have to purely declare it's value locally?

7
C - C++ / Ordering Numbers into Ascending Order
« on: December 18, 2015, 08:23:48 pm »
Hey, so a few posts ago I showed some code regarding ordering numbers into ascending order. I discovered the bubble-sort algorithm and after being sent this code by a user on this forum, decided to see if it worked. However it doesn't output anything.

I have absolutely no idea why as the for loop at the bottom should output all the numbers ... but for some reason it doesn't (or at least 1 number).



This should work .. the first loop checks the value of the first number against the value of the second and then the third etc.
The outer for loop counter then makes it reset the j counter inside and so starts all over again. There are 100 checks on the various numbers in the array 's'.

Then at the end the for loop will simply print out the array 's' based on the value of 'i' at each of the loop counts. I fail to see what is actually going wrong here.

This is the console window:



As you can see, the array seems to get stored and potentially sorted.. but then the program just ends.

Any help would be great :)

8
C - C++ / Re: Rearranging Numbers in Ascending Order
« on: December 15, 2015, 01:23:44 pm »
You're using iostream for input and stdio.h for output for some reason. In C you should use stdio.h, iostream is a C++ library.

Printing "k" is pointless because k by itself is actually a pointer to the beginning of that array. You want to print elements of it.

My hints are:
1. First, read all the elements in one loop.
2. Rearrange the array so it fits your criteria. You want ascending order so every element should be greater than all of those before it, not some temp element. Not sure what your idea was with that one too.
3. Print the array correctly.

You should really go learn the basics of the language from the beginning, and not ask people to help you with your homework. And if you do, there are plenty of other places you can do so, this one is primarily for learning.

Well the basics of the language are what exactly? I am using variables, loops, conditional statements etc .. the only thing i'm not doing is creating code that efficiently serves this purpose. This is not 'homework', its a starter project I have been working on for 3 days. I'm sorry to burst your pseudo-intellectual bubble, but i'm not expecting you to solve my problem for me. I would just be appreciative of anything that anybody can tell me about how best to understand the rules for sorting through array elements.

9
C - C++ / Rearranging Numbers in Ascending Order
« on: December 15, 2015, 01:01:33 am »
So I have a project where I need to organise people's pancake entries into ascending order depending on how many they ate.

However the current code I have to do it at the moment is faulty and outputs the following:



4710496 comes from nowhere from what I can see. The code I am using is as follows:



My reasoning is that the if statement will sort the largest number in the array and then that number will get stored in k. This makes sense as when it goes through it will take the largest number from all 10 and store it in the holder array (k). The values in array k will then get outputted.

Of course I am going wrong somewhere, but I am very new to arrays and the idea of array manipulation using loops so if anyone could help me I would be greatly appreciative.

Many Thanks,
Drahgon

10
C - C++ / 'char' rather than 'int' causing double loop
« on: December 10, 2015, 01:18:51 am »
The problem:


My Code:


The issue I have:
For some reason when I enter a number that conforms to >=10. It asks me to enter the number twice without taking an input for the first loop round. [See the console window below]. I know why it is, it is because I have set 'input' to 'char' instead of int. Why then is it looping when I reach 10? Memory issue? Random Glitch?



11
Beginner's Corner / C++ IDE/Compiler for Windows 10 ?
« on: December 09, 2015, 01:48:08 am »
I have tried CodeLite, NetBeans, CodeBlocks and DevC++. None of which work.

OS: Windows 10

Beginner C++ programmer who just needs an IDE that can compile and run a f*cking program -_-

Can anybody help?

P.S .. sorry if i'm pissed off, this should not be a problem in 2015. It should be *Click install button* -> *Works*. I need to save my patience for important problems like debugging.

12
You need to understand that the people posting are coming from a neutral rational position and so will not care as much about your objectives as you do.

Best thing to do is, before you post anything, think about compiling what you have written into 'evilzone' code and define exactly what you want to do and why you want to do it. Serve it on a plate.

I know it's frustrating as you find this on stack overflow all the time, people don't seem to take you seriously. But the best thing to take from it is that people aren't taking it seriously for a reason. Backtrack through what they aren't taking seriously, learn more about it.

IF learning more about it gives you the answer to your own question
THEN say thanks and end query
ELSE revise original post to include new information to better guide people to your intentions and knowledge boundaries

13
Hacking and Security / Re: Ok so here is the Deal
« on: January 27, 2014, 02:39:59 pm »
Guess what, you live with them. Chances are they bought you your ps3, your computer, the Netflix subscription, and pay the internet and electricity bills. So shut the fuck up and deal with it. Plus, like vezzy said, if your dad actually knows anything about networks, he won't believe your bullshit for a second. Hacking is not about abusing the people that love you and provide for you you little turd.

lol you have issues my friend, I bought my PS3, I bought my computer, you obviously didnt read the part where I said that they use "MY" (MY as in, i fucking bought it) PS3 to watch netflix.
 
Damn im surprised your lackluster IQ allowed you to find your way onto this forum

Why not join them for Sunday Movie Night? :) Nothing like good ol' family bonding time. Trust me, when you get out of the house and on your own for a few years, you'll start to wish you had spent more time with them as a teenager/young adult.

Maybe, coerce them into watching action movies, or a romantic comedy; hell, if you want to troll them, ask them if they'd be interested in watching some porn as a family :D

haha, porn as a family. Damn I can only imagine the awkwardness. But im obviously getting the vibe that nobody will help me with this.

Yes, this isn't the place for lame teenage pricks as lucid pointed it out, but there are some options where you can resolve this problem.

 - Try to play online games when your parents aren't using Netflix.
 - Talk to your parents about this problem.
 - Kill your parents and flee to Latin America

If I were you, I would choose the third solution. You can thank me later  ;)

Damn, you are quick to judge, well im guessing that since your levels of maturity are about as abundant as a seals chances to be a 100m sprinter I'm not even going to continue with bothering with you.

STAFF NOTE: Do not double, triple post. Use the modify button instead

14
Hacking and Security / Ok so here is the Deal
« on: January 26, 2014, 11:07:22 pm »
My mum and dad are always on Netflix when I am playing online games, I need a way to restrict bandwidth so that I continue with my 50ms ping and they get the shitty 300 I get when they are online.


I have tried QoS and most people dont find it to be very good as you still have a set width of connection strength. I am looking into firewall rules however I want to be sneaky about it. I dont want to ban it from the network as I could have done that by now and they would know that something was up.


My dad is fairly familiar with networking but if I can pass off the whole "we have bad internet" thing then I will be fine. Its almost like my router is downgrading my priority even though I was on it first. Surely they should get the bad ping and connection width.


As it seems they are now really pissing me off and they are using my PS3 to watch this shit. I'm working on a Netgear DGND3300v2 router.


Any help would be appreciated. This is the side of hacking I like. Screwing over your parents on a Sunday night XD

Pages: [1]