111 Posted Topics

Member Avatar for taha umar
Re: hi

[QUOTE=jwenting][code]string ponter = new string;[/code] [/QUOTE] Shouldn't that be [code] string* ponter = new string;[/code] :?:

Member Avatar for ITgeneration
0
332
Member Avatar for JoBe

Hello ladies and gents, I'm trying to include a copy constructor and an assignement operator into this code wich has two separate classes, the idea is to copy the last name that was entered. Problem is, I can't seem to grasp how to get acces to the copy constructor in …

Member Avatar for Lerner
0
340
Member Avatar for Geek-Master

[QUOTE=Geek-Master]Does anyone know of a college in Georgia that offers a complete online BS in Game Development or Computer Science?[/QUOTE] Think you'd better ask that question at the [url=http://www.gamedev.net/community/forums/][COLOR=Red]GameDev forums[/COLOR][/url]

Member Avatar for Geek-Master
0
88
Member Avatar for JoBe

Hello ladies and gents, I was trying to write a small example of a pointer to a two dimensional array like this after looking up how to write the syntax at Narue's Et.Conf. world like this: [code] #include <iostream> #include <iomanip> void array(short (*myArray)[4][4]); using namespace std; int main() { …

Member Avatar for Narue
0
136
Member Avatar for moznmar

>Do this //Constructor CBooks()[COLOR=Red]{}[/COLOR]; >You hadn't defined the Constructor. Only declared it. And **remove** the semicolon: CBooks(){};

Member Avatar for moznmar
0
264
Member Avatar for JoBe

Hello ladies and gents, I was just wondering how you would implement this into C if it actually is possible, if not, how do you guys implement an equal way of dealing with this in C ? For instance, if you would have classes like this in C++: [code] class …

Member Avatar for Ancient Dragon
0
139
Member Avatar for JoBe

Hello ladies and gents, I hope the moderators won't mind me posting this here, if they do, feel free to move it, but since it is related towards C++, I figured it belonged here ;) A while back I was browsing the GameDev forums and I found this thread in …

0
128
Member Avatar for JoBe

Hello ladies and gents, Wondered if any of you could help me out here, I'm trying to increment an element of a vector of integers. Here's the code: [code] #include <algorithm> #include <cctype> #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<int> scores; scores.push_back(500); scores.push_back(600); scores.push_back(300); …

Member Avatar for JoBe
0
6K
Member Avatar for kahaj

[QUOTE=kahaj]Narue's site? Where would I find that at?[/QUOTE] Here ya go: The Eternally Confuzzled World of [url=http://www.eternallyconfuzzled.com/index.html]Narue[/url] :mrgreen:

Member Avatar for winbatch
0
185
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about Virtual Function in my book and there is this programming that shows how and what happens, I understand what is happening but one thing that came to my mind is that, previously in my book, there was mentioned that you should allways …

Member Avatar for Ancient Dragon
0
785
Member Avatar for comwizz

[QUOTE=iamthwee] j++ means j == j +1 [/QUOTE] I think you ment j = j + 1 right :?:

Member Avatar for Rashakil Fol
0
173
Member Avatar for geeta

[QUOTE=WolfPack] you can also use [code]system("pause" );[/code] statement before the return statement to make the program pause till you press a key.[/QUOTE] I thought Ive read on several occasions that this should be avoided since it is bad programming :?:

Member Avatar for WolfPack
0
488
Member Avatar for dj_money

[code] #include <iostream> using namespace std; int main() { int stop = 0; while (true) { stop++; cout<<"Hello!\n"; if(stop == 5) break; } return 0; }[/code] OR [code] #include <iostream> using namespace std; int main() { int i = 0; for(;;) { i++; cout<<"Hello!\n"; if (i == 5) break; } …

Member Avatar for brian63304
0
2K
Member Avatar for JoBe

Hello ladies and gents, I was reading about how "Passing by References" for efficiency and there was a little program added wich shows what the difference is between passing by value and passing by reference is. The program is this one: [code] #include <iostream> using namespace std; class SimpleCat { …

Member Avatar for JoBe
0
247
Member Avatar for Elthran

[code] #include <iostream> using namespace std; int main() { char ch = 'j'; while(ch == 'j' || ch == 'J') { cout << "Enter height in centimeters: "; int centimeters; cin >> centimeters; cout << "Your height in feet " << centimeters << endl; cout<<"Wish to enter a new number? …

Member Avatar for ITgeneration
0
947
Member Avatar for nir_kar
Member Avatar for Narue
0
138
Member Avatar for JoBe

Hello ladies and gents, I'm reading about the algorithm partial_sum and there are two different versions of this. The first one just calculates cumulative numbers like this: [code] #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int a[4] = {10, 20, 30, 40}, b[4]; partial_sum(a, a+4, …

Member Avatar for Stoned_coder
0
102
Member Avatar for JoBe

Hello ladies and gents, Im reading about working with maps and there is small programm example shown in this chapter. Now, when I write this code into the MS VC C++ compiler and compile the code, I get like over 90 warnings, however, when pressing compile again, they all are …

Member Avatar for Ene Uran
0
694
Member Avatar for indianscorpion2

Hi Narue, I was just wondering wether you guys ever thought about adding several [B]Post Icons[/B] stating wether the questions is related towards C, C++ or additional on compilers, etc... Probably you'll think that this will be forgotten more then it'll be used, then maybe the forum can be altered …

Member Avatar for jhdobbins
0
311
Member Avatar for JoBe

Hello ladies and gents, Have a few questions about the following example that is given: [code] #include <iostream> #include <fstream> using namespace std; int main() { char ch; int n=0; ifstream ff("aa"); if (!ff) { cout << "Can't open file aa for input.\n"; return 1; } ofstream gg("bb"); if (!gg) …

Member Avatar for Dave Sinkula
0
449
Member Avatar for JoBe

Hello ladies and gents, In my book, I'm currently reading about the use of creating your own operators << and >> for in- &output. There's been given a small example that goes like this: [code] #include <iostream> using namespace std; class vec { public: vec(float x1=0, float y1=0) {x = …

Member Avatar for Stoned_coder
0
283
Member Avatar for JoBe

Hi Narue, Ive started your tutorial on pointers and had a few questions about it if you don't mind. 1) You talked about the fact that a function has an adres itself and that you can call a function threw it's adres. This I understand, as I tried it out …

Member Avatar for Narue
0
302
Member Avatar for mozira

[QUOTE=mozira]... i am doing the program and asking help from fellow C++ geniuses.[/QUOTE] :lol: From fellow C++ geniuses hey, well, there certainly are several hanging around here, but seeing as you even use void main(), I'm certain your not one of them :lol: Don't know about you, but saying to …

Member Avatar for Narue
0
499
Member Avatar for brycegordon

Maybe better would be to take a look at the list of books Dave Sinkula has made: [QUOTE=Dave Sinkula]With regard to C++ books, I'll just echo the advice [url="http://groups.yahoo.com/group/c-prog/message/37324"]here[/url]. The following books are recommended; read them in mostly the order listed. "Accelerated C++" Andrew Koenig & Barbara Moo "The C++ …

Member Avatar for vegaseat
0
387
Member Avatar for JoBe

Hello ladies and gents, I had to do an exercise in wich I was required to compair two standaardtype strings opposits, meaning: name = "Johan", name2 = "nahoJ" The idea was to return a bool value True or False. I did this with the following code I wrote:[code]#include <iostream> #include …

Member Avatar for Dave Sinkula
0
249
Member Avatar for JoBe

Hello ladies and gents, Came across a program example in wich you are able to sort program-parameters in alphabetical order. The code is this:[code] #include <iostream> #include <string> using namespace std; void sort2(char* &p, char* &q) { if(strcmp(p, q)> 0) { char *h; h = p; p = q; q …

Member Avatar for JoBe
0
370
Member Avatar for shre86

Hi, You have made a declaration of your pointer *b, but where is the definition of it :?: A pointer is an adress and must be assigned towards one, meaning, you'll need to use 'new' to assign an adress towards b. Hope this helps.

Member Avatar for Narue
0
191
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about how when a class becomes to big due to to many memberfunctions, it is best to split the program up into several sections wich could be something like this: Interface section Implemenation section Application section I was given an example wich is …

Member Avatar for JoBe
0
495
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about when you have a very large program, that it is advisable to divide this into several modules. Ive tried this out with an example of two separate modules that where given as examples and managed to get two .cpp modules into the …

Member Avatar for JoBe
0
240
Member Avatar for JoBe

Hello ladies and gents, I'm trying to output a 2D array, but can't seem to find the solution, can anyone help me out here. [code] #include <stdafx.h> #include <iostream> using namespace std; int main() { int **pp; int i, j, n, ni; cout<<"Geef het aantal regels als volgt: "; cin>> …

Member Avatar for JoBe
0
586
Member Avatar for Narue
Member Avatar for Dave Sinkula
0
146
Member Avatar for JoBe

Hello ladies and gents, Wanted to make this part of an exercise in wich I enter each time two integers into an array for wich I have to use STL container vector. Ive got this sofar, but getting an error message when I entered two numbers and the exe shuts …

Member Avatar for JoBe
0
592
Member Avatar for JoBe

Hello ladies and gents, Ive got a question concerning how to actually send a program to someone (only the exe.file) so that he/she sees what the program can do without having the possibility to alter anything towards the code itself? I'm using Microsoft Visual C++ 6.0 incase you need to …

Member Avatar for winbatch
0
118
Member Avatar for JoBe

Good evening everyone, This next exercise, I have to do the following: Write a ClassTemplate for a linked list. Demonstrate it by using two linked lists. The datafield of the first type is int, the second one is double. What Ive got sofar is this: [code] #include <iostream> #include <vector> …

Member Avatar for Dogtree
0
228
Member Avatar for JoBe

Hello ladies and gents, I wanted to ask if this piece of code can be written differently then the way I did: [code] template <class V> void sequence3(V &a, V &b, V &c) { V w; while (a > b || b > c) { if (a > b){w = …

Member Avatar for JoBe
0
187
Member Avatar for JoBe

Hello ladies and gents, Ive got this example of a program that I tried out wich shows some special possibilities to use new. [code] #include <iostream> using namespace std; int main() { int a[100]= {0}; for (int i = 0; i < 100; ++i) a[i] = 100 * i; int …

Member Avatar for Fasola
0
276
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about pointers abit and at there are two pieces of text in the book about pointers wich aren't clear to me, was wondering if any of you could enlighten me abit about them! :D [quote]Sometimes it's desired to clearly point out that a …

Member Avatar for JoBe
0
163
Member Avatar for JoBe

;) Hello ladies and gents, Ive written this class time in wich I have to use operator+ to increase the hour with a certain amount of minutes like this: time t0 (23, 59), t1; // t0 = 23.59 t1 = t1 + 120; // t1 = 1.59 Problem is, I …

Member Avatar for Narue
0
646
Member Avatar for msaqib

Why go anywhere else if we have people like Narue, Dave, Vegaseat, Asif, ... to ask questions towards, besides, Daniweb has got alot of tutorials aswell :!:

Member Avatar for JoBe
0
112
Member Avatar for mdbrock7

Hi, Ever tought about using the Algorithm of Euclides? Example of getting the greatest common devider gcd(1147, 851) Steps: 1) 1147 = 1x851 + 296 2) 851 = 2x296+259 3) 296 = 1x259 + 37 4) 259 = 7x37 Rest equals 0. Then the gcd equals 37. If you can …

Member Avatar for Narue
0
280
Member Avatar for JoBe

Hi ladies and gents, Next exercise is the following: Write the function which we can declare as follows: unsigned char bcd (int n); The idea of this function is to store the last two decimal numbers of n into a 'binary coded decimal' byte and to return this value. So, …

Member Avatar for Narue
0
604
Member Avatar for Acidburn

Hi Acidburn, Don't know if it's correct, but don't you have to write: [CODE]bool Date::testEqual(Date &someDate) { if (Date == someDate) return true; else return false; }[/CODE] :?:

Member Avatar for Acidburn
0
170
Member Avatar for JoBe

Hi ladies and gents, I wanted to start a new exercise, but after reading it several times, I actually don't know what the exercise is all about :!: The translation into English is this: [quote]Write a function wich can be declarered as the following: unsigned int datecode(int year, int month, …

Member Avatar for Narue
0
402
Member Avatar for JoBe

Hi ladies and gents, I made this exercise in wich recursion has to be used and it worked as it should: [CODE] void ggd(short x, short y) { short a = 0; if (y == 0) { cout<<"The largest common divider is: "<< x <<endl; } else { a = …

Member Avatar for JoBe
0
185
Member Avatar for JoBe

Hi ladies and gents, I'm trying the next exercise: Write a function value, wich adds the decimal numbers of 'n' together and return the result of this into main? For example: 0.1234 = 10 0.01234 = 10 0.3286 = 19 What Ive got so far is this: [CODE] short amount …

Member Avatar for JoBe
0
299
Member Avatar for blackdove

[quote]I also get 2 errors saying: (37) : error C2065: 'max' : undeclared identifier (40) : error C2065: 'min' : undeclared identifier[/quote] It means that in main, these two aren't declared! What are they, integers, floats, an array, ... Out of curiousity; Tough I'm far from a programmer and I'm …

Member Avatar for blackdove
1
151
Member Avatar for JoBe

Hello ladies and gents, I'm starting on the next exercise, but I'm puzzled a bit and was wondering if any of you might help me with this. I have to enter four integer numbers, non negative and smaller then 16 into ONE variable int x, now, the thing I was …

Member Avatar for Fasola
0
443
Member Avatar for JoBe

Hello ladies and gents, I'm trying to write this little program in wich I have to enter by keyboard a certain amount of numbers (int) not floating points, and the program must count how many [U]different [/U] numbers I have entered, when the amount is equal to ten, it must …

Member Avatar for JoBe
0
855
Member Avatar for Acidburn

[QUOTE=Acidburn]hello, ok here it goes... I've got a char array but it doesnt want to let me add data to it!! I cant figure out why [php] //skip the program heres the line... int chararry[12][10] = {Jan, Feb....} [/php] but I keep getting an error saying its not been initialized... …

Member Avatar for 1o0oBhP
0
290
Member Avatar for JoBe

Hello ladies and gents, I was making this small exercise in wich I have to enter a certain date meaning, day, month and year. If entered it should count the amount of days from the beginning of that year and print it. I found a solution for this, but was …

Member Avatar for Narue
0
306

The End.