128 Topics

Member Avatar for
Member Avatar for alex4700

I'm having a hard time understanding where is the problem... I have a class which is responsible connecting to DB and passing queries. (basically Data Access Layer) and it looks like this: [code=php] class DB { private $connection; public function __construct(){ $this->connection = mysql_connect('localhost', 'user', 'pass'); mysql_select_db( 'dbname', $this->connection ); …

Member Avatar for cwarn23
0
118
Member Avatar for seanvitalaim

Can someone please explain to me why I cannot move variables from object to object. I've been getting no sleep and burning myself out learning java and it is driving me crazy here is the example. [CODE]import static java.lang.System.out; class ONE { public static void main(String[] args) { TWO addition …

Member Avatar for NormR1
0
97
Member Avatar for DarkT

Hi everyone. We were given a homework to code a hash table. The objects and their members were given by our professor and we were only supposed to implement the functions (Add, Remove, Contains and Print), so I shouldn't change the objects. I should also do a copy constructor and …

Member Avatar for DarkT
0
2K
Member Avatar for TheWolverine

Hi all, I am just getting into the world of OOP and I'm not totally sure in what situations it's better to use objects and when it's simpler to just revert to arrays. For example, I am currently re-writing a bit of scientific code written in C that simulates the …

Member Avatar for TheWolverine
0
163
Member Avatar for nomemory

Hello, regarding OOP I have Java background, and I usually think in java when I code OOP in python (which sometimes is actually a bad thing). [CODE=python]#!/usr/bin/python class Card(): SUIT = { 'C':'Clubs', 'D':'Diamonds', 'H':'Hearts', 'S':'Spades' } VALUES = { '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, \ '10':10, …

Member Avatar for nomemory
0
385
Member Avatar for Froger93

Hey guys, I have a problem. I have a connections_lib.php file this will handle all of my db connections, this works AMAZINGLY (power of OOP). Unfortunately some of my other classes require connection to the databse therfore they must use these methods (is that the right word for OOP I'm …

Member Avatar for Froger93
0
180
Member Avatar for Wolf CCMLG

I am desperately need help converting my code into an OOP format. [B][I]Here is my code:[/I][/B] [CODE] #include <iostream> #include <string> #include <cstring> using namespace std; const int strLength = 141; char strArray[strLength]; char answer; bool quit; int charAmount; string line; void vowelCount(string); void consonantCount(string); void consonantCount(string line) { int …

Member Avatar for dkalita
0
174
Member Avatar for codejoust

Would anyone be able to provide pointers / comments on this object-oriented PHP program? You can take a look at it on [URL=http://github.com/codejoust/PHPContactForm/]http://github.com/codejoust/PHPContactForm/[/URL] It's still a work in progress.

0
108

The End.