- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 12
- Posts with Upvotes
- 12
- Upvoting Members
- 9
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
student
- Interests
- C++, video games, Latin
202 Posted Topics
Re: It has to do with the way your compiler is interpreting strings (I think it happens when you set the character encoding to unicode instead of multibyte, or something like that). I [i]think[/i] that this: [CODE]PlaySound((LPCWSTR)"beep.wav", 0, SND_LOOP|SND_ASYNC);[/CODE] will work. | |
Re: [QUOTE]Simple - because I must.[/QUOTE] You [I]must[/I]? Was it assigned to you for your job or something? I don't have any industry experience, but I'm pretty sure a decent boss wouldn't give a huge project like this to a single person with limited programming experience. VernonDozier's suggestion of breaking up … | |
Re: Gears of War had 32 people JUST on programming (12 were listed under "Unreal Engine Programmers"). In total, around 150 people from Epic Games alone worked on the game. Bioshock (surprisingly to me), had less, around 24 programmers listed in the credits. I was too lazy to count all of … | |
Re: They can also be passed as pointers, if you want to use them. Thought I believe it's considered better to use references over pointers when possible. [CODE] class MyClass { // blabla }; void foo(MyClass* obj) { // class passed by reference } int main() { MyClass myclass; // create … | |
Hey, I'm a C++ programmer, but I'm beginning to learn Java, and from what I see so far the two languages are very similar. The main difference I hear is that C++ has pointers and Java doesn't, but from my understanding Java does have pointers in a sense, the user … | |
Re: It is considered one of the "harder" languages, but as AncientDragon said, hard is a relative term. C++ was really the first language I learned, and I didn't have any real experience with other languages. So if you want to learn it, don't hold back because it's "hard". | |
Re: I ran this for fun. Is it necessary to cast the addresses as ints before subtracting? I printed both addresses, and saw that they were 4 apart, but [ICODE]&x[1] - &x[0][/ICODE] came out as 1. But when I cast them to ints, it was 4. Why is the cast necessary? | |
![]() | Re: Sorry for reviving a dead topic, but... I still don't have nearly enough programming knowledge to know what everyone was talking about here, but I think I almost sort of get pointers. I couldn't help but think of a database and UID's. IF you had a database of customers and … |
Hey, Right now I'm using XP, and I was thinking of getting a laptop. Now, I've heard a lot of bad stuff about Vista, but most of the things I heard are "It sucks." Or "don't get it" or "it's extremely slow". Now, except for the last one those are … | |
I've been trying to code a catch me game (for anyone who doesn't know: a game with a ball that randomly jumps around the screen - the goal is to click the ball before it moves, and not to miss it). I've got the clicks part down. You can click … | |
Re: People have already done the work for you. The Direct3D extensions library (d3dx) has functions for loading bitmaps into Direct3D surfaces or textures. Unless you want to manually load the bitmap into your program as a learning experience, or if you just feel better doing things yourself, use Direct3D (or … | |
On a laptop running Windows XP, I can't seem to view webpages or actually connect to any server. Going to pages in IE or firefox give me unable to connect/cannot display errors. Trying to ftp to a server through windows explorer or filezilla gives me simmilar errors. Everything I do … | |
Hey, I download DarkGDK for Visual C++ 2008 Express (also downloading the correct version of the Direct X SDK). I just saved the SDK in some random directory, so when I try to execute the test code, i get an error telling me d3dx9.h can't be found. So, where do … | |
I have a child of std::exception defined as: [CODE=c++] struct image_load_failed : public std::exception { image_load_failed(std::string const s) : message(s) {} virtual ~image_load_failed() throw() {} const char* what() const throw() { return "image load failed";//message.c_str(); } std::string const message; }; [/CODE] (I would normally have what() return message.c_str(), but I've … | |
Re: If you're on windows, a common way to do it is [ICODE]system("PAUSE");[/ICODE]. It gives a prompt like "Press any key to continue..." | |
I'm trying to load a bitmap into an Image object using the following code: [CODE=Java] System.out.println("Point A"); System.out.println("Point B"); m_image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(filename)); System.out.println("Point C"); MediaTracker mt = new MediaTracker(null); System.out.println("Point D"); mt.addImage(m_image, 0); System.out.println("Point E"); try { System.out.println("Point F"); mt.waitForID(0); System.out.println("Point G"); } catch (InterruptedException ie) { System.err.println(ie); System.exit(1); } … | |
Re: [QUOTE]graphics is not part of either c or c++ languages.[/QUOTE] I think he meant that he has not learned how to create programs that use 3D or advanced 2D graphics (like those used by a game) in C++ yet. Obviously what you said was correct, but someone who hasn't made … | |
Does anyone actually use the .hpp file extension for C++ header files? I've never seen it used, but I was just working with geany, and I noticed that it only syntax highlights C++ specific things if the file extension is .hpp (or .cpp, obviously, but not .h). So what's the … | |
Hey, I just recently ran into a problem compiling a C++ project (no, I didnt mean to put this in the C++ forum). I got an error saying that a certain header file couldn't be opened (I had compiled with the same file before). I looked up the error and … | |
Re: It would be very difficult to write a game with C++ without the use of a graphics API like Direct3D or OpenGL. The only real function you have with Win32 programming is DrawPixel() (or is it SetPixel()...something like that). Loading bitmaps like that would be VERY difficult. | |
I'm trying to upload .js files onto my sever. This is the code: [CODE]<html> <head> <title>Add Ubiquity Command</title> </head> <body> <form action="add_ubiquity_cmd.php" method="post" enctype="multipart/form-data"> Name: <input type="text" name="name" /><br /> Description: <textarea rows="8" cols="30" name="description"></textarea><br /> JS File: <input type="file" name="file"><br /> <input type="submit" value="Add Command" /><br/> </form> <?php if(isset($_POST["name"])) … | |
Does mysql_real_escape_string() escape HTML character entities? I want people on my comment board to be able to post quotes in their comments, but they get escaped as raw ascii, so I run them through htmlentities() first, but it doesn't help. I only get it to work when I remove mysql_real_escape_string(), … | |
Hey, Are any of the brands of memory considerably better than any of the others? Should I worry about that, or should I worry more about the actual memory I'm getting. thanks. | |
Hey, I'm a first-time builder, and I just have some questions about what components to get. 1. How many watts do I need for my power supply? I know there are calculators for that online, but I'd rather get a rough estimate from a human. I'm getting an Intel Core … | |
Hey. I've never worked in industry, and I was just curious as to how exactly things work in the real world (as a C++ programmer). To be a bit more specific, what kind of things do you do in a day? If you're working on a program, how many people … | |
Re: What is an experience score (don't have Vista)? Is it like a performance rating? | |
Re: There have been a few games that were cross platform. Shadowrun combined players from both Vista-PCs and Xbox 360s, though these are both Microsoft platforms. It is definitely not impossible, but the extra work it takes may be more than developers are willing to do given the benefits of the … | |
Hey I'm writing a color class, and I want to have a constructor that can take in an unsigned int like 0x00FF00FF and interpret it as fully opaque green. I have code for that (I think it should work, could someone check it?): [CODE] rzb::color::color(unsigned int hex) { m_red = … | |
Hey. I'm planning on buying a desktop, but I'm a little confused as to the difference between 32-bit Vista and 64-bit Vista, and exactly what those differences entail. Now, I think the technical difference is the size of the memory bus. Well, if I'm right, I'm not exactly sure what … | |
Hey, I've been trying to create an RPG, and I really have trouble moving with it. I really can't find any decent tutorials (or even books). The only book I've heard of (Making RPGs with DirectX, or something, by Jim Adams) got pretty bad reviews. The part I can't really … | |
Re: Do you indeed want to make it have a GUI? If so, follow linux0id's advice - you're going to need to use some sort of API. | |
Hey, I'm learning Objective-C, and they use [ICODE]#import "File.h"[/ICODE] instead of [ICODE]#include "File.h"[/ICODE]. The tutorial I'm using says that import is like an include once thing, and it basically implements the #ifndef blocks that's normally done manually in C++. I was just wondering if this is something specific to Objective … | |
Re: @williamhemswort namespaces shouldn't end with a semicolon (though AD didn't point that out so I'm not sure I'm right about that...). I also don't think non const variables can be defined outside a function, though I could be wrong about that as well. Not sure what's wrong with the using … | |
Re: [QUOTE=Duoas;666121]The [b]rand[/b]() function does not return a pointer to an int. It just returns the int. ([URL="http://www.cppreference.com/stdother/rand.html"]reference[/URL]) So attempting to [b]delete[/b] it is causing your error. [/QUOTE] Wait, are you talking about this line: [CODE] *drawn = rand() % 52+1; [/CODE] rand() returns an int but drawn has been dereferenced … | |
Re: Any method of the mainFrame class has access to both m_library and m_player. So you can have a method called GetNextTrack() (or w/e): [CODE] class mainFrame : public Gtk::Window { public: void GetNextTrack() { //m_library and m_player can both be accessed in this scope } private: library *m_library; player *m_player; … | |
Re: Post the errors and a description of your problem/question. edit: Sorry, didn't see the comments in your code. Still good to post a description of the issue though. I see a couple of strange things, but the one related to your union: [code] union { int number : 4; }; … | |
Re: You would use ifstream to read data (much like cin), and ofstream to write it (like cout). (note: cout and cin are objects of classes that are already made. ifstream and ofstream are actual classes). To write data: [CODE=C++] ofstream fout("file.sav"); fout << health << "\n" << mana << "\n" … | |
Re: Don't use spaces between in the code tags for them to work. That code is swapping the variables word[i] and word[j]. Temp is needed to do the switch (at least the way it's being done here). Say you have a bucket A full of orange juice and bucket B full … | |
Re: The reason the line you commented isn't working is because [ICODE]save.dna[i][/ICODE] is of type char, but [ICODE]"T"[/ICODE] is of type char* (I believe, maybe it depends on the compiler?). Try changing it to [ICODE]'T'[/ICODE] | |
Re: For reading data from text files: [URL="http://www.cplusplus.com/reference/iostream/ifstream/"]ifstream[/URL] | |
Re: 1. You didn't listen to one of the above posters. Don't do this: [CODE]cin >> name; [/CODE] If I type a name that's larger than 20 characters your program will crash. 2. Unless this is for a class and your instructor says you must use character arrays, use std::strings. They're … | |
Re: [QUOTE=chanda gul;664838]i think instead of directly assigning one string to another u should use strcpy function..try it...[/QUOTE] Kind of off topic, but strcpy() is meant for use with C-Strings (i.e., char*). When using std::strings (which you should :) )you use the (overloaded? ) assignment operator. | |
Re: Are you on a console? If so, I don't think there's a good, definite way to do that (though I could be wrong). | |
Re: [ICODE]( x || y )[/ICODE] is an expression of type bool (at least I think so - even though you can't declare variables of type bool it still exists as a type) [ICODE]true[/ICODE] is of type int. I believe this comparisan of int to bool is causing the issue (though … | |
Re: Always post your errors! [CODE]struct Weather[/CODE] What is this? The syntax is improper and I'm not sure what you're trying to do. [CODE] month[0] = January; month[1] = February; month[2] = March; month[3] = April; month[4] = May; month[5] = June; month[6] = July; month[7] = August; month[8] = September; … | |
Re: I don't know which [I]awesome[/I] games you saw at the apple store (especially because apple isn't too well known for games), but even if you were using C++, you would not be able to create a game like Empire at War on your own. My guess is 20-30 programmers alone … | |
Re: What exactly is mouse handling? Do you mean reading mouse input? DirectInput is an expensive solution - there may be some simpler methods in the Win32 API. | |
Re: This: [ICODE]module = new MyClass(true);[/ICODE] line should not work in either case. [ICODE]module[/ICODE] is of type MyClass, but [ICODE]new MyClass(true)[/ICODE] is of type MyClass*. That assignment shouldn't work - are you sure the latter example compiles? Also, use [noparse][code][/code] tags, not [quote][/quote] tags.[/noparse] | |
Re: Always post the exact errors you get for the best help. [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html"]atio()[/URL] takes input of type [ICODE]const char*[/ICODE]. do this: [CODE] x=atoi(str.[COLOR="Green"]c_str()[/COLOR]); [/CODE] Or, better yet, use stringstreams: [CODE] #include <sstream> using namespace std; int main() { stringstream ss; int x; string str = "34"; ss << str; ss >> … | |
Re: All you're doing is defined a method of MyClass called Cout. To, use it, you would have to call it: [CODE] MyClass obj; obj.Cout(); [/CODE] the cout you use to do things like cout << x; is not a function, it's an object. Look in to [URL="http://www.cplusplus.com/doc/tutorial/classes2.html"]operator overloading[/URL], if you … |
The End.