English | Magyar
JS ki | CSS ki | Ékezetek ki | HiContrast
Lapozó:  (0 - 1424) 
<== | ==>
Ugrás a végére | Összes megjelenítése | Utolsó oldal
OpenOpera patches | Opera-SSL patches | Opera 12.15 source (Git repository) | Opera 12.15 source (Torrent) | Opera internal pages | Otter Browser Linux x64 - Qt5.15.2/QtWebKit5.602.1 (2024.04.27. 20:05)
OS for MC680x0 | OS for PPC | OS for Sparc64 | besztofbégéaefcé | CSÉNDZSLOG | WebToolz | DDG Shit Filter | Google Shit Filter | Progz | Fast CSS Box | Browser | OS | Agent | Statisztika | BBCode
Monospace font-family: Courier New | Browser default monospace
Email értesítő / Email notification ===> 
Keresés
Σ: 1 post

kemi  (statz) Főfasz
#2, Főfasz (2970)
1675 | #2236 | ^ | Idézet | Fri, 07 Dec 2012 11:09:25 +01
94.21.*.* Linux x86 Google Chrome Hungary *.pool.digikabel.hu
@TCH:
kemi, már péntek van. :P
Eddig úgy néz ki, hogy oké, de azért még este megkérdezem.
Nekem ez a C64 verzió jobban bejön. Amit te belinkeltél az már egy japán remix C64 remixe, ez viszont az eredetiről van.
C++-ban a sima tömböt túl lehet indexelni, akkor jobb esetben hülyeséget olvas be a programod, rosszabb esetben lefagy. Azonkívül függvénynek nem tudsz tömböt átadni paraméterként, csak tömbre mutató pointert, annak viszont nem mindig tudod a hosszát. Fórumokon erre a vector-t javasolták, ami viszont dinamikus tömb, úgyhogy írtam egy ahhoz hasonló osztályt, de statikus tömböt tárol, indexelésnél ellenőriz, és mindig lehet tudni a hosszát, meg C++ zéhára jó referenciakód, mert benne van minden amit tudnia kell egy objektumnak. :P
#ifndef ARRAY_H_
#define ARRAY_H_

#include <stdexcept>

template <class T>
class Array {
public:
	Array(int length) {
		__length = length;
		__array = new T[__length];
	}

	Array(Array<T>& arr) {
		__length = arr.length();
		__array = new T[__length];
		for (int i = 0; i < __length; i++) {
			__array[i] = arr[i];
		}
	}

	virtual ~Array() {
		delete __array;
	}

	Array<T>& operator =(Array<T>& arr) {
		delete __array;
		__length = arr.length();
		__array = new T[__length];
		for (int i = 0; i < __length; i++) {
			__array[i] = arr[i];
		}
		return *this;
	}

	T& operator [](int idx) {
		if (idx >= 0 && idx < __length) return __array[idx];
		else throw std::out_of_range("Index out of range.");
	}

	int length() { return __length; }

private:
	int __length;
	T* __array;
};

#endif


English | Magyar
JS ki | CSS ki | Ékezetek ki | HiContrast
Lapozó:  (0 - 1424) 
<== | ==>
Ugrás a végére | Összes megjelenítése | Utolsó oldal
OpenOpera patches | Opera-SSL patches | Opera 12.15 source (Git repository) | Opera 12.15 source (Torrent) | Opera internal pages | Otter Browser Linux x64 - Qt5.15.2/QtWebKit5.602.1 (2024.04.27. 20:05)
OS for MC680x0 | OS for PPC | OS for Sparc64 | besztofbégéaefcé | CSÉNDZSLOG | WebToolz | DDG Shit Filter | Google Shit Filter | Progz | Fast CSS Box | Browser | OS | Agent | Statisztika | BBCode
Monospace font-family: Courier New | Browser default monospace
Email értesítő / Email notification ===> 
Keresés

Név: (max 255 byte)

Email: (max 255 byte) Nem kötelező!

Üzenet: (max 65536 kar.) 65536-0=65536




crap_vkn v4.34.0 by TCH
Thx to saxus for the escaped string decoder function (PHP), the realIP function (PHP) & the SQL handle layer (PHP), to thookerov for the int_divide function (PHP), to Jeff Anderson for the getSelText function (JS), to Alex King for the insertAtCursor function (JS), Flood3r for the new CSS styles, Pety for the spamprotection idea and some design and comfort ideas, MaxMind for the IP2Country database, famfamfam for the flags of countries and an unknown PHP programmer for the removeAccents function.



Kecskebaszók ide!