87 Posted Topics
Re: You're not calling it. To call a function, use, for example, [icode]cd3.returncosts()[/icode] | |
Re: [QUOTE=Ancient Dragon;595785]your coding style is terrible. Don't be afraid to use more white space -- it won't slow down the compile time any and won't take up any more room on your hard drive.[/QUOTE] Seconded. :P | |
Hey. I want to make a packet structure, something like [code=c++]struct Packet { int cmd; /* command */ int len; /* length of body */ char body[30]; /* body (should be length of len though, might use std::string) */ };[/code] Now, if I recieve some data thru a socket (I'm … | |
Re: .......it's [U][B]not[/B][/U] hard at all. (edit: lol a little late, sorry I was reading the other thread) | |
Re: 55: should be [icode]openInputFile("infile.dat");[/icode] (even then it won't work, infile.dat is a string not an ifstream reference) just take this line out and it should be fine. 77: [icode]if (strcmp(array[index], minValue) < 0))[/icode] you have an extra ) [quote]74:error: Stropy was not declared in the scope 77:error: Stromp was not … | |
Re: Do you need to memset() movem to null? I'm not sure, I'm pretty much a beginner at C++. I'd compile it if it had newlines in the code tag... | |
Hey. Right now in my game (online) I'm using std::vectors to store player info. Should I continue to use them (I hate having to loop thru them each time to find a player) or should I use MySQL to hold player information (like map their on, nickname, id, position, etc.)? | |
Re: I didn't read it all but change the line in main to: [code=cpp] getData(marital, numChild, exempt, noOfPeople, groSalary, penAmt);[/code] Don't put the data-types in the function calls edit: and you re-declare alot of stuff...... | |
Re: Here's a working example (I wrote in ~5 minutes), but write your own and use mine as an example on a way to approach it. [code=c++]#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { char value[50] = {0}; /* our character array */ char c_tmp[2] = … | |
Re: I like Lua. It's easy to implement in C/C++ and can call C/C++ functions if you register them. But if Python is easy to implement, it's alot more powerful; and generally easy to script. | |
Hey all. I'm making an online game. It uses XML maps, and I was wondering... what's the best way to transfer an XML file over a socket? I want my server to send an XML map whenever it's requested, but I dunno how I'd get the xml from the other … | |
Re: How about XOR encryption? It's a nice way to encrypt files. | |
Re: [code=c++]char buf[100]; int i; strcpy(buf, "foo"); i = atoi(buf);[/code] that? | |
Re: [code] BloodDonor(long=0 ,string ="",string ="",string ="",string ="",int =0,int =0,int =0,string ="",string ="");[/code] don't think you can set default types in c++ | |
Re: Python is an [b]awesome[/b] scripting language, and it's very extensible. I used to use it all the time, but now I'm learning C++. I wouldn't touch java, it's JVM is slow (IMO slower than Python's interpreter) and it's just terrible. | |
Re: your problem is you're pointing to a Linux location in a Windows environment. Install curl (if not installed), change the path to point to it, or check if curl is bundled with the PHP install. | |
Re: How about FMOD or something... Also, MySQL is easy. Anyone can learn it, so just read a few tutorials. | |
Re: currentlevel is always 1 in changelevel(), the [icode]if(currentlevel == 1 &&[/icode] code must not be executing. ;) | |
Re: try putting [icode]global gold[/icode] as the first statement in any function that uses the variable 'gold' | |
Re: also, you need to set [icode]length[/icode], use strlen() for that. | |
Re: The beep is due to an ASCII character, consoles read it as a beep. I dunno how you can stop it, though. | |
Re: yeah, 'vall' isn't a constant - you need to change it to $vall and declare it before. | |
Re: if you mean CAPTCHAs, it's done by PHP not Javascript. | |
Re: and you can't set php variables from within JS. your code sets $impt to 'Y'. | |
Hello. I'm using JS/DOM to create a map in a <div>, named map, like this: [code=javascript]var tile = document.createElement("IMG"); tile.src = "tiles/" + node.getAttribute("type"); tile.setAttribute("width", "32"); tile.setAttribute("height", "32"); tile.className = "brick"; map.appendChild(tile); [/code] It works, but the image breaks on a <br/> (screenshot: [url]http://i28.tinypic.com/6ynu3o.png[/url]) the image is a 32x32 tile … | |
Re: err, I dunno if this is the problem, but you don't have any semi-colons terminating ANYTHING? also, you might want to use css for the onmouseover | |
I'm using MySQLdb. Alright, I'm doing [code=python]import MySQLdb as mysql db = mysql.connect("localhost", "root", "password", "database") cu = db.cursor() rows = cu.execute("INSERT INTO users (user, pass) VALUES ('test', 'test')") print "rows affected:", rows cu.close();db.close()[/code] Well, what happens is, it gets executed and prints "rows affected: 1" BUT when I check … | |
Re: use mysql_error()... oh, and you named your vars wrong.... ;) see if it works now [code=php] <?php $dbhost = "localhost"; $dbuser = "root"; $dbpassword = "spewguts"; $dbdatabase = "productsdb"; $db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Error: ".mysql_error()); mysql_select_db($dbdatabase, $db); $sql = "SELECT * FROM products"; $result = mysql_query($sql) or die("Error: … | |
Re: For an SQL query, use something like [code]$var = mysql_real_escape_string(htmlspecialchars($_GET['param'])); mysql_query($var);[/code] I dunno, that's what I use. Let a real expert tell you. :P | |
Re: Why can't you do it? You gotta post the problem. OS? Web server? | |
Re: If it doesn't work, you're not doing it right. Learn basic PHP skills before you post. @ryan_vietnow: you might want to simplify that; the function returns what is_numeric does on it's own. Just do something like [code=php]$x = $_GET['foo']; echo is_numeric($x);[/code] @lydia21: you posted this same thread 3+ times... | |
Re: Instead of "self.ent.get()=solution" are ya wanting to do [code=python]self.ent.set(solution)[/code]? Happy coding. | |
Re: [QUOTE=kkeith29;434726]Actually a few days ago i got bored and thought since they block anything fun at school I would make a chat program to talk with friends. It uses php, mysql database, and a little ajax. Its very simple to do in fact.[/QUOTE] I've done that, too. I'd like to … | |
Re: Try it like this, [code=php]<h2>View my GuestBook!!</h2> <?php require_once("dbconnect.php"); $exe=mysql_query("select * from guestbook") or die("SQL Error: ".mysql_error()); while ($r=mysql_fetch_array($exe)) { echo "<b>Name: {$r['name']}<br>\nLocation: {$r['location']}<br>\nEmail: {$r['email']}<br>\nURL: {$r['url']}<br>\nComments: {$r['comments']}<br>\n</b>"; } ?>[/code] If that doesn't work, open up a MySQL console and do [code=sql]use guestbook;[/code] [code=sql]select * from guestbook;[/code] If there is messed … | |
Re: For Windows, I recommend Dev-C++, or even Visual C++ 6 For *nix, I use G++ But yeah, it's best to get started by reading the stickied topics. |
The End.