Search found 240 matches

by mv2112
Tue Mar 02, 2010 3:51 pm
Forum: Programming Discussion
Topic: <SOLVED>Define multidimensional array in a object
Replies: 11
Views: 756

Re: Define multidimensional array in a object

Well, this is what iv been working on for two days lol. Makes text on console look cooler. You can put any char in a grid on the screen. its not all done yet but here is a little program i made it only works on windows here is the mvGLIB.h #include <iostream> #include <fstream> #include <string> #in...
by mv2112
Tue Mar 02, 2010 1:56 pm
Forum: Programming Discussion
Topic: <SOLVED>Define multidimensional array in a object
Replies: 11
Views: 756

Re: Define multidimensional array in a object

What you are trying to do is impossible without using dynamic memory. The problem is that the compiler allocates the array (and anything not allocated with new and delete) on the stack rather than the heap. This means that as soon as your object is instantiated with: object a(10,10); //now the arra...
by mv2112
Mon Mar 01, 2010 7:49 pm
Forum: Programming Discussion
Topic: <SOLVED>Define multidimensional array in a object
Replies: 11
Views: 756

Re: Define multidimensional array in a object

I gave up on regular arrays and i used multidimensional vectors instead. :mrgreen: Here is the code: #include <iostream> #include <fstream> #include <string> #include <ctime> #include <time.h> #include <windows.h> #include <conio.h> #include <vector> #include <algorithm> #include <cstdlib> using nam...
by mv2112
Mon Mar 01, 2010 7:46 pm
Forum: Programming Discussion
Topic: <SOLVED>Define multidimensional array in a object
Replies: 11
Views: 756

Re: Define multidimensional array in a object

What you are trying to do is impossible without using dynamic memory. The problem is that the compiler allocates the array (and anything not allocated with new and delete) on the stack rather than the heap. This means that as soon as your object is instantiated with: object a(10,10); //now the arra...
by mv2112
Mon Mar 01, 2010 5:20 pm
Forum: Programming Discussion
Topic: <SOLVED>Define multidimensional array in a object
Replies: 11
Views: 756

<SOLVED>Define multidimensional array in a object

What im trying to do is create a multidimensional array whos size differs depending on what the user enters. I want to define the array when the object is declared in main but i cant figure it out. Here is my code so far... #include <iostream> #include <fstream> #include <string> #include <ctime> #i...
by mv2112
Fri Feb 26, 2010 10:03 pm
Forum: Programming Discussion
Topic: [SOLVED]Unwanted linebreak when outputting to a textfile
Replies: 5
Views: 358

Re: Unwanted linebreak when outputting to a textfile

hurstshifter wrote:
mv2112 wrote:wow, that was simple lol :oops:
Does anyone know why cin>>in; doesnt work?

I believe it is because it reads the spaces as null characters. A null character would signify the end of a string in traditional C strings.
That does makes sense. Thanks for the quick replies!
by mv2112
Fri Feb 26, 2010 9:39 pm
Forum: Programming Discussion
Topic: [SOLVED]Unwanted linebreak when outputting to a textfile
Replies: 5
Views: 358

Re: Unwanted linebreak when outputting to a textfile

wow, that was simple lol :oops:
Does anyone know why cin>>in; doesnt work?
by mv2112
Fri Feb 26, 2010 8:53 pm
Forum: Programming Discussion
Topic: [SOLVED]Unwanted linebreak when outputting to a textfile
Replies: 5
Views: 358

[SOLVED]Unwanted linebreak when outputting to a textfile

Ok, so i wrote a program that asks you for a file name you want to create or edit, and then streams text to it. Its basicly just a simple text editor. After each line of text, there is a line break. My problem is that when i have a string with spaces, it makes each space a new line. Why is it doing ...
by mv2112
Thu Feb 25, 2010 5:30 pm
Forum: Programming Discussion
Topic: [SOLVED] How much c++ should i know before learning a API?
Replies: 11
Views: 732

Re: [SOLVED] How much c++ should i know before learning a API?

K-Bal wrote:Not too bad ;) Did you notice that Player and Enemy have many things in common? They are both some kind of entity that can attack, defend, etc. A base class for both would fit perfectly ;)
I did notice that they had some things in common, ill have to try making a base class.
by mv2112
Thu Feb 25, 2010 4:41 pm
Forum: Programming Discussion
Topic: [SOLVED] How much c++ should i know before learning a API?
Replies: 11
Views: 732

Re: [SOLVED] How much c++ should i know before learning a API?

I would just try to create a Pong, Pickin' Sticks or an other extremely simple game. The worst thing that can happen is that you fail. In this case, read some articles/books about it and try again. while(createSimpleGame() != done) { ++brain; } Edit: And show us your results ;) Edit2: One more thin...
by mv2112
Thu Feb 25, 2010 3:51 pm
Forum: Programming Discussion
Topic: [SOLVED] How much c++ should i know before learning a API?
Replies: 11
Views: 732

Re: How much C++ should you know before attempting an API?

mv2112 wrote:Ok, i get it, i think i'v got a lot more to learn about c++ before i master it lol 8-) .
Now I understand pointers a little better, I just ran into a problem where I wanted a member function to access another object's variable and it worked when i used pointers!
by mv2112
Thu Feb 25, 2010 1:51 pm
Forum: Programming Discussion
Topic: [SOLVED] How much c++ should i know before learning a API?
Replies: 11
Views: 732

Re: How much C++ should you know before attempting an API?

Ok, i get it, i think i'v got a lot more to learn about c++ before i master it lol 8-) .
by mv2112
Wed Feb 24, 2010 8:04 pm
Forum: Programming Discussion
Topic: [SOLVED] How much c++ should i know before learning a API?
Replies: 11
Views: 732

[SOLVED] How much c++ should i know before learning a API?

How much c++ should i know? I just started learning about Objects and im getting the hang of it, pointers on the other hand... :roll:
When would you even use pointers? I cant think of any reason, but then again, i am a noob at c++.
Also, anyone ever use DarkGDK?
by mv2112
Wed Feb 24, 2010 6:57 pm
Forum: General/Off-Topic
Topic: Official "Hello, World! (I'm new!)" thread
Replies: 821
Views: 587920

Re: Official "Hello, World! (I'm new!)" thread

Hey, im Mike. I just joined the forums a few days ago. Im 14 years old and i hope to become a game developer some day. I'v been programming for about 2 years. I'd say im "fluent" in HTML and PHP(mostly HTML) and im learning C++. I switch between Visual C++ and Dev C++ and use ConTEXT for ...
by mv2112
Wed Feb 24, 2010 5:15 pm
Forum: General/Off-Topic
Topic: Official "Hello, World! (I'm new!)" thread
Replies: 821
Views: 587920

Re: Official "Hello, World! (I'm new!)" thread

Hey, im Mike. I just joined the forums a few days ago. Im 14 years old and i hope to become a game developer some day. I'v been programming for about 2 years. I'd say im "fluent" in HTML and PHP(mostly HTML) and im learning C++. I switch between Visual C++ and Dev C++ and use ConTEXT for h...