Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 32,279 points

Frxstrem

Favorite Answers30%
Answers383
  • Learning C++ - good tutorials or other resources?

    So, I've been trying to learn C++ for about two-three weeks, but I haven't found any great resources.

    Could someone please recommend it a basic learning resource for C++, that preferably does not require you to know C, and is free.

    3 AnswersProgramming & Design1 decade ago
  • Any tips for changing from Windows to Linux (Ubuntu)?

    So, I am trying out Ubuntu 10.4 (the beta version), and if I get everything working, I will probably switch to it too. Do you have any tips for making the best transition from Windows to Linux?

    I am experienced with computers, and I have some minor experience using Linux, but ANY tips at all would be great!

    5 AnswersSoftware1 decade ago
  • Dynamically created objects in PHP?

    I have two questions. You only have to answer one of them, but answers to both would be great ;-)

    First question: Say I want to make an object dynamically, like this:

    <?php $object = (object) array('var1' => 'foo', 'var2' => 'bar'); ?>

    or this:

    <?php $object = new stdClass(); $object->var1 = 'foo'; $object->var2 = 'bar'; ?>

    Is it possible to then add a function to that object, without having to assign it a class?

    Second question: Is it possible to dynamically assign variable key names inside a class, for example:

    <?php class SampleClass { function __construct($key, $value) { $this->[$key] = $value } } ?>

    This is invalid PHP syntax, but I hope you still get the point.

    Thanks,

    ~ Fredrik

    3 AnswersProgramming & Design1 decade ago