202 Posted Topics

Member Avatar for 11silversurfer1

You may get better responses to DirectX specific questions in the Game Development forum, or in the [URL="http://forums.xna.com/forums/"]XNA forums[/URL] (it's mostly centered on using the XNA tools with C#, but there are some forums on DirectX, and I do believe it's supposed to be the official DirectX forum). As to …

Member Avatar for 11silversurfer1
0
473
Member Avatar for asad12

It's always a good idea to post the specific errors you get from the compiler. I think you may be initializing your array incorrectly. Listing all the elements as you have done may not be the proper way to populate a multidimensional array. [CODE]void display_draw(int mega[12][6], int draw_index); [/CODE] This …

Member Avatar for ArkM
0
109
Member Avatar for Evan M

Couldn't he also use pointers? [CODE] if( TTF_Init() < 0 ) { return 1; } Font* thing = new Font; delete thing; TTF_Quit(); [/CODE]

Member Avatar for Evan M
0
237
Member Avatar for ambarisha.kn

Yes - std::strings are [COLOR="Green"]good[/COLOR]. char* and char arrays are [COLOR="Red"]bad[/COLOR]. In case you're wondering why you can't use the == operator with char*, think about it. buff is a pointer to a char. In other words, it contains the address of a single char, and so should be compared …

Member Avatar for CoolGamer48
0
86
Member Avatar for CoolGamer48

Hey, I'm running into some issues with delete[]. I have these lines: [CODE] delete[] temp1; delete[] temp2; [/CODE] in a loop. temp1 and temp2 are pointers to std::strings. In the first iteration of the loop, temp1 and temp2 are both NULL pointers. The statements work fine. In the second iteration, …

Member Avatar for CoolGamer48
0
1K
Member Avatar for herms14

[QUOTE=herms14;648813]it also doesn't work. I've tried it but my outputs are some strange symbols nothing else..[/QUOTE] Show us your file. How are the numbers separated? I would use the >> operator, not the get() method. Also, on further review, I seem some weird things in your loop. First, you read …

Member Avatar for CoolGamer48
0
121
Member Avatar for henpecked1
Member Avatar for henpecked1
0
108
Member Avatar for fmwyso

I learned C++ from C++ for Dummies. I enjoyed it, but I've heard bad things about it because it has typos. I did notice a couple of typos when going through it, but it was nothing I couldn't bare or make sense of. Still, there may be better books out …

Member Avatar for Dave Sinkula
0
146
Member Avatar for guy40az

If you'd like to link to a lib through the compiler's interface rather than using #pragma, right-click on your project's name in the panel to the left, go down to properties, expand linker, go to input, and put the libraries names in the additional dependencies field, separated by spaces.

Member Avatar for CoolGamer48
0
153
Member Avatar for Code Shark

@AncientDragon Doesn't the loop you give continually ask for strings until you enter one that doesn't have an 'i'? The original program just asked for one, and check if there was an 'i' in it, then ended. You can reduce lines 14-25 to [CODE] if( strchr(word,'i') ) { cout << …

Member Avatar for Prabakar
0
211
Member Avatar for sambafriends

Do you want an example to explain classes in English, or in C++? Or perhaps both? Is there something specific about classes you don't understand?

Member Avatar for CoolGamer48
0
113
Member Avatar for jasonperez

If you have a file, and you have pieces of data in the file seperated by whitespace, and you know the type and order of those pieces of data, you can just use an ifstream object. For example, if you have a file that has a string with someone's first …

Member Avatar for jasonperez
0
126
Member Avatar for sambafriends

Data is very, [I]very[/I] important. To try and prove otherwise wouldn't make sense. If you mean create a program that ignores a piece of data: [CODE=C++] #include <iostream> using namespace std; int main() { int x; cin >> x; cout << "Hello\n\n"; cout << "We do not care about your …

Member Avatar for CoolGamer48
0
143
Member Avatar for stewie griffin

You may also want to consider learning the Windows API:[URL="http://winprog.org/tutorial/"]http://winprog.org/tutorial/[/URL]

Member Avatar for stewie griffin
0
160
Member Avatar for jack1234

[QUOTE=Alex Edwards;647371]Hmm I wonder... [code=c++] typedef void VOID [/code] =P[/QUOTE] I'm pretty sure that exists too. I also love this one (not sure if its in Windows API or DirectX): [CODE=C++] #define 1 TRUE #define 0 FALSE typedef int BOOL; [/CODE] It's just a way to make types sort of …

Member Avatar for CoolGamer48
0
127
Member Avatar for amit1701

If you're on Windows: [ICODE]system("PAUSE");[/ICODE] may be what you're looking for, though you can't get the character that was pressed, if that's also what you wanted (wasn't sure).

Member Avatar for iamthwee
0
159
Member Avatar for SonxQ7

But wait, doesn't this work? [CODE=C++] int x; cin >> x; [/CODE] x is an int, not a reference to one. Is it different when you're dealing with function return types and just the data type of a variable?

Member Avatar for CoolGamer48
0
118
Member Avatar for Q8iEnG

Do you know about [URL="http://www.cplusplus.com/doc/tutorial/templates.html"]templates[/URL]? You could create a Linked List template class to make things easier to understand. Though, on second thought, creating a linked list template class can be a hassle, and giving you one wouldn't teach you anything about linked lists.

Member Avatar for Q8iEnG
0
156
Member Avatar for justinclev

What type of program are you dealing with? A window? A console window? Most likely, the answer will lie somewhere in either the Direct3D (Microsoft), or OpenGL (open source) APIs. Look them up.

Member Avatar for CoolGamer48
0
146
Member Avatar for Alex Edwards

C++ is powerful. As was mentioned, the JVM was written in C++. If you can't do something in another language, do it in C++. As is evident by the fact that the JVM is written in C++, you can create languages with C++. Almost all of the software you use …

Member Avatar for sciwizeh
0
293
Member Avatar for anuizath2007

EDIT: Dave beat me to it, but read it anyway if you like (apparently I was missing a few things). [QUOTE=anuizath2007;646815]i didnt get you!!!![/QUOTE] Firstly, wrap your code in CODE tags, and specify a language (i.e. [ CODE = C++ ], w/o the spaces) so that there are numbers - …

Member Avatar for anuizath2007
0
97
Member Avatar for anuizath2007

[QUOTE=iamthwee;646696]Well why do you have a return in the function, you shouldn't need one because you are passing back by reference.[/QUOTE] Wait, I'm not sure if he edited the code in the first post, but the function just had [ICODE]return;[/ICODE], not [ICODE]return someVal;[/ICODE]. It's not neccesary to include the return; …

Member Avatar for anuizath2007
0
88
Member Avatar for CoolGamer48

Hey, I'm writing an XML parser in C++. Currently it works, but too much of what needs to be done is left up to the end user. I'm trying to figure out a way to have a clean, more encapsulated interface for the parser, but I can't seem to think …

Member Avatar for dougy83
0
117
Member Avatar for sasikala123

No one's going to do the homework for you. If you have some code that you're having problems with or if you have a basic layout for the program but need help moving forward, post that here.

Member Avatar for Sky Diploma
0
136
Member Avatar for Black Magic

I think you would use the system() function. I'm no expert on the windows command line, but I think you can run programs from it. If so, you could pass a command to run firefox or ie, thought I'm not sure if you can pass the url as a command …

Member Avatar for Ancient Dragon
0
106
Member Avatar for wtf???

The c-string temperatures is declared [ICODE]char *tempatures;[/ICODE], but never intialized. Then you try to use it in the constructor for temperature [ICODE]ofstream tempature(tempatures, ios::app);[/ICODE]. You need to tell the compiler what file to open.

Member Avatar for wtf???
0
206
Member Avatar for balla4eva33

Like the others have said - post your specific problem. This isn't your error, but it's a bad idea to put function implementations in .h files. If you include the same .h file more than once in different files that are within the same projects, you will get issues. The …

Member Avatar for CoolGamer48
0
154
Member Avatar for Black Magic

You would actually name the file myFile.h, not myFile.cpp. When you #include something you are basically taking the contents of the header (*.h) file and dumping them into your current .cpp file. If the file you need to include is in your current working directory (or if you're specifying an …

Member Avatar for CoolGamer48
0
221
Member Avatar for aaaaaa1

Are you serious? It's bad enough people come here and ask for homework, but you actually named your post "Do my homework for me."? Read the forum rules, no one is going to do your homework for you. Also, doubly linked lists are NOT reffered to as DLLs. A DLL …

Member Avatar for Ancient Dragon
-2
143
Member Avatar for CoolGamer48

What's the difference exactly between opening a file stream in the default text mode and opening it in binary mode? The cplusplus.com article on file i/o mentioned a few things, but I really didn't get the gist of it. Could someone explain it? Thanks.

Member Avatar for hacker9801
0
452
Member Avatar for camthalion95

I'm assuming it took many trained, experienced, professionals working an absolute minimum of 8 hours a day a couple of years to write the Unreal engine (again, an assumption). I'm not sure how much experience you have, but I don't think you're going to have too much luck witting an …

Member Avatar for camthalion95
0
141
Member Avatar for CoolGamer48

When using >> to extract data from an istream, are spaces skipped over? I.e., if I extracted every character from: "Hello, my name is not World.", would the 5 spaces not be read by >>? If so, is this behavior omitted from istream::get()? Thanks.

Member Avatar for titaniumdecoy
0
110
Member Avatar for monkey123

I've always wondered, is this: [CODE]int atr = amountToReturn; [/CODE] a good/safe way of truncating the decimal portion of a float/double? Should it be type-cast? Or should you use the floor() function?

Member Avatar for CoolGamer48
0
82
Member Avatar for licruzny

No one's going to do this for you. If you have a specific question - ask that. To start off, do you know what a linked list is?

Member Avatar for licruzny
0
163
Member Avatar for CoolGamer48

Hey, I'm attempting to write an XML parser in C++, and I have some questions on some XML syntax. First: what is the rule for what goes between the end of the last attribute and the end of a tag? E.g.: is this ok:[ICODE]<tag attribute="value" >[/ICODE]? is this ok:[ICODE]<tag attribute="value">[/ICODE]? …

Member Avatar for Narue
0
161
Member Avatar for Clockowl

[QUOTE=Clockowl;641765]And that won't happen with the #ifndef "protection", if I'm right.[/QUOTE] I'm not so sure: if file A #includes file B, and file B #includes file A, and file A is #included by the main project first, then this will happen: file A #includes file B file B #includes file …

Member Avatar for Clockowl
0
173
Member Avatar for CoolGamer48

Does this code look right for centering an image on the screen (in this case a chess board): [CODE=C++] int Chess::Board::Center(int width,int height) { if(m_texture == NULL) return 0; D3DXVECTOR2 center; center.x = (float)width/2.0f; center.y = (float)height/2.0f; m_position.x = center.x - (m_texture->GetWidth())/2; m_position.y = center.y - (m_texture->GetHeight())/2; return 1; } …

Member Avatar for CoolGamer48
0
106
Member Avatar for jk_bscomp

Practically [I]anything[/I] is possible in C++. They can be extremely difficult, but they tend to be possible. How much experience do you have with C++? The project you're talking about seems very ambitious. I definitely don't think I would be able to do it, and I'm doubtful that programs like …

Member Avatar for Salem
0
132
Member Avatar for nokeekon

If you want a good deal of control over the sound, you might want to consider DirectSound (though using it can be very annoying and complex). If not, I believe there is a simple Windows function that you can use to play sounds asynchronously, but I can't remember it on …

Member Avatar for CoolGamer48
0
837
Member Avatar for CoolGamer48

Hey, I'm starting out Java development, and I want to know exactly what I need to download. I believe I need to download the JVM, but what else? And I know there are IDEs like NetBeans where you can just press a button to build and/or run the program, but …

Member Avatar for ~s.o.s~
0
99
Member Avatar for Pikachumanson

This function: [CODE] void ENTITY::SetLife(int newLife) { if (life < 0) life = 0; } [/CODE] Doesn't set the life at all. All it does is check to see if the current life is less than zero, and if so, sets it to zero. The input parameter is ignored. That's …

Member Avatar for CoolGamer48
0
124
Member Avatar for nokeekon

If you select 1 without first setting x with 2, you may receive unexpected results. You haven't told us what's not working correctly, and I'm going to go ahead and assume that you want the variable x to retain its value even after the program closes. This is not what …

Member Avatar for nokeekon
0
254
Member Avatar for Jennifer84

Er... I'm not exactly sure what you're asking, but it sounds like you may be searching for the break command. Having [ICODE]break;[/ICODE] anywhere in a loop will end the current iteration and end the loop. If that's not it, then [ICODE]continue;[/ICODE] will end the current iteration, but instead of breaking …

Member Avatar for Jennifer84
0
129
Member Avatar for CoolGamer48

Hey, I'm working on a chess game, and I'm creating two enumerations - for piece_color and piece_type. I'm wondering what the difference is (whether it's an actual difference in the way the program executes or a matter of good object-oriented practice) between having the enums be global or having them …

Member Avatar for Dave Sinkula
0
80
Member Avatar for timmyj97

Do you know any programming languages? Before using SDKs you're going to need some basic coding knowledge. C++ is probably what you should shoot for (if you've found XNA and used it, you would be using C#, Microsoft's variant of C++). Learn C++. Some people may say its too difficult …

Member Avatar for morrock
0
295
Member Avatar for CoolGamer48

Hey, I'm trying to run a simple DirectX program, it loads a model and displays it. I run it once, and it works. I run it again, doesn't work. Didn't change any code. Just recompiled, and it doesn't work. I'm not sure if the issue is with my computer (which …

0
72
Member Avatar for cycras

I do believe that older versions of the Unreal Engine (which is the engine used to make UT3 that you were referring to) are available at prices affordable by an average individual (vs. an entire gaming company or someone who's extremely rich). I heard somewhere that the very first version …

Member Avatar for morrock
0
135
Member Avatar for CoolGamer48

Hey, sorry if this is the wrong place for this, but... A while ago I was thinking of getting a new laptop. At first I was going to focus on battery life, but as time went by I saw myself caring less about that and more about a quality machine. …

Member Avatar for maydhyam
0
180
Member Avatar for CoolGamer48

Hey, sorry if this is in the wrong forum. My computer keeps crashing, causing it to restart, and I don't know why. Here's what I know: [LIST] [*]It's happened only on Windows XP [*]Its happened on one of my machines multiple times,and just started happening on my second [*]The crashes …

0
53
Member Avatar for CoolGamer48

Hey, What will happen if you link to the same lib twice using #pragma? Will this cause an error, or if the lib is already being linked to, will the second #pragma be ignored? Thanks.

Member Avatar for William Hemsworth
0
46

The End.