Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


NotYourAverageUser

Member Since 08 Dec 2006
Offline Last Active Oct 06 2014 12:00 PM

Posts I've Made

In Topic: Why Do I Lose Data In a Char Pointer When Passed Into or Over a Function?

14 September 2014 - 02:40 PM

 

A better way would be

char srcBuffer[MAX_LENGTH]
sprint_s(srcBuffer, MAX_LENGTH, "Hello World!");

char dstBuffer[MAX_LENGTH]

bool errorVal = doLogic(srcBuffer, dstBuffer); // return false if dstBuffer is too short

 

That is certainly the "C" way of doing things and it sounds like this is what the OP's goal is.


In Topic: Battleship in java

08 August 2014 - 08:58 AM

I don't want to argue semantics with people, I just want to know how to optimize my code. 

 

He was not arguing semantics, he was informing you that you didn't really do what was suggested to you.

 

Doing what has been suggested, breaking down specific tasks into separate methods, you should be able to end up with a main method that looks similar to rip-offs main.  This will help with readability and maintainability and will give you specific, contained areas of code to work with to optimize.  


In Topic: How do you retrieve data to php page from a database, for somebody in specifi...

01 August 2014 - 08:40 AM

How do you currently connect to your database? How are you saving it to the database?  What kind of DB?

 

Retrieval will be pretty much the same.  You perform a query, SELECTing whatever columns you are interested in where some field equals the current user's id.  Then you just set the values of the form fields equal to the values retrieved from the DB.

 

It is not clear exactly what the question is; is it:

  1. How do I connect to a database in PHP? - Though your question makes it seem that you already know how to connect because you are already saving the data.
  2. How do I retrieve data from a database in PHP?
  3. How to log a user into the system? - though it looks like you are already doing this.
  4. How to edit data in a database in PHP?
  5. How to set form field values in PHP?

Not sure why you would be getting someone else's info for the form. 

 

This is all pretty basic and is quite easily googled for a full working solution.


In Topic: I'm feeling lucky

01 August 2014 - 06:32 AM

poor guy...


In Topic: iterator output not in sync

03 July 2014 - 11:16 AM


I immediately knew that vector3D v = vecIterator.next(); wouldn't work because the return type doesn't match vector3D data type

 

This is not true.  It does match, how else do you think you can access the public members of the vector3D class from vecIterator.next()?

 

Wooh's post should work exactly as is.  I would suggest you try to run it.

 


you all kept refering to Wooh's fix which can never be the correct fix

Not only is it the correct fix, but had it not been he even explained to you why you should expect to see the behavior you do when running your program.  And how you could get the behavior you require.


PARTNERS