Jump to content

Lyrex

Member
  • Posts

    5
  • Joined

  • Last visited

Awards

This user doesn't have any awards

  1. Oh, sure. The C++ thing is my bad. If you have to do it recursively, then the only thing making at least a bit sense is the following: void remove_last(node_t* node) { if (node->next && node->next->next) remove_last(node->next); else { delete node->next; node->next = nulltr; } } Run it twitce to remove both last elements. But care, it can easily smash you stack if the list is too long.
  2. Umm, I'm not too sure what kind of list you're using. Can you provide some more information about the container type? It would help a lot if you told us what it is (linked list, double linked list, reverse list, queue, etc). It would probably help too if you tell us the programming language, you're using. Your code looks like C++, is that correct? And as you said, recursion really does not seem to make any sense when doing simple operations like adding or removing elements on lists. Things change if you're trying to implement sorting or such, but that's not the case.
  3. Okay. I've read the thread and I'm pretty concerned about the update status of your software. Microsoft introduced like a year ago a feature which you can enable that makes skype to re-route all it's traffic over Microsoft servers. That way, nobody can get your IP. Fine, you probably have not checked the option but then again: Like two months ago, Microsoft announced that they have fully removed all direct peer-to-peer connections which make it impossible to resolve your IP. It needs to be said, that this works only with the current skype client. So if you do not have it updated, go and do it. If you did this, reconnect your network and see if you have a new IP. If not, u've got a static IP and you're pretty much.. well, let's say not in the best position. If you do have one, contact your provider if it's possible to change it. If it has changed, you're good to go. Don't visit any links or sites you don't know, if you're paranoid use a protected VPN (there are some pretty good ones, if you don't mind having a high latency, use some from romainia) but you can't really do anything else. In no case try to fight back or something. You can get into serious legal troubles which you really don't want to have.
  4. Hey cisto, my advice would be to build a NAS on your own. Mostly, that's a pretty good way to go and not too hard to do if you're a little bit into reading guides. Depending on your situation, where the NAS is going to be, how big it can be and so on, you'd have do decide on your own, which compromises you do want to make. I'd really recommend you to use some kind of fan or cooling in the system. It can be an ultra low spinning fan which - I guess - you won't hear ore something fancy. You can still of course go with passive cooling, but then you should really thing about building the NAS on your own. You can throw whatever stroage you'd like in and you've got plenty of room on upgradability (not just one or two disks if more is needed). Oh, and streaming the files off your PC is usally totally fine as long as the connection is. if it drops, the stream will obviously stutter and get pretty nasty. But since your WLAN AP is in the same room, there shouldn't be any problems. But one final remark to add: It seems that you plan to use the NAS just as output machine to connect a TV to or such. This is because who is using a NAS if he does not need any storage on it? Either you misunderstood the purpose of a NAS, or you're.. I don't know. Just don't buy one if you don't need it. If this is true, and you just need a network receiver thingy, use something like an Arduino or a Raspberry PI. You can stream your media right off your PC onto your raspi and display the video output on your TV. Save's a lot of money with only little work.
  5. Lyrex

    C++ Help

    I made up an example for you, I hope it's sufficient: http://ideone.com/57LnhW #include <iostream> void square_ref(int& a); int square_val(int a); int main() { int a = 2; int s = 2; std::cout << "a: " << a << ", s: " << s << std::endl; std::cout << "------" << std::endl; square_ref(a); square_val(s); std::cout << "a: " << a << ", s: " << s << std::endl; std::cout << "------" << std::endl; square_ref(a); s = square_val(s); std::cout << "a: " << a << ", s: " << s << std::endl; return ; } void square_ref(int& a) { a = a*a; } int square_val(int a) { return a*a; }
×