FireNet 64 Posting Whiz in Training

:)

Displaying the image is real easy if it is not encrypted ...

You can use glut + corona to easily display images.
http://www.daniweb.com/forums/thread63827.html#5

Also if you are having problems with leftover bytes at the end of the file smaller than your buffer, use the following bit of code to find the file size

// obtaining file size
#include <iostream>
#include <fstream>
using namespace std;

int main () {
  long begin,end;
  ifstream myfile ("example.txt");
  begin = myfile.tellg();
  myfile.seekg (0, ios::end);
  end = myfile.tellg();
  myfile.close();
  cout << "size is: " << (end-begin) << " bytes.\n";
  return 0;
}

http://www.cplusplus.com/doc/tutorial/files.html

Divide the file size by your buffer size, run the loop with the number you get (the quotient) and read the remaining data using the remainder as the read size.

^^


Also, it possible to display encrypted data, just that it would look like a bunch of random pixels .... The standard format is RGB, so you can create a single color out of 3 bytes of data, 0-255, standard char. Read up an OpenGL tutorial on creating a texture ......

FireNet 64 Posting Whiz in Training

Use binary mode to open files which deal with encrypted text.

That should solve the problem with the EOF char :)

P.S Refer to my reply to your mail.

If you get it working post the working program here :D

FireNet 64 Posting Whiz in Training

use the function mysql_escape_string();

It will make sure all the characters are escaped and safe to use in a mysql query

escaping a character is adding a \ in front of a character. Eg: \'


Hope that fixes your problem.

FireNet 64 Posting Whiz in Training

Simple.

Take the text of the article as a string, crop the string to a certain size, append "......" to the string and display it.

<?php

/*################################################################
#                                                                #
# You pass the script a string, a length you want the string     #
# to be and the trailing characters, what the function does,     #
# is takes the string, finds the last word that will fit into    #
# the overall length, and return a string that has been cropped. #
# The function makes sure that a word is not cut in half.        #
#                                                                #
##################################################################
#        Written by David Speake - david@evilwarus.com           #
#      Adapted from Oliver Southgate's ASP interpretation        #
#     http://www.haneng.com/code/VBScript/CropSentence.txt       #
##################################################################
#                                                                #
# Examples:                                                      #
#                                                                #
# $strTemp = "Hello, I am a fish and you are not.";              #
# $strTemp = CropSentence($strTemp, 16, "...");                  #
# //returns "Hello, I am a..."                                   #
#                                                                #
# $strTemp = "Hello, I am a fish and you are not.";              #
# $strTemp = CropSentence($strTemp, 17, "...");                  #
# //returns "Hello, I am a fish..."                              #
#                                                                #
################################################################*/

function CropSentence ($strText, $intLength, $strTrail) 
{
    $wsCount = 0;
    $intTempSize = 0;
    $intTotalLen = 0;
    $intLength = $intLength - strlen($strTrail);
    $strTemp = "";

    if (strlen($strText) > $intLength) {
        $arrTemp = explode(" ", $strText);
        foreach ($arrTemp as $x) {
            if (strlen($strTemp) <= $intLength) $strTemp .= " " . $x;
        }
        $CropSentence = $strTemp . $strTrail;
    } else {
        $CropSentence = $strText;
    }

    return $CropSentence;
}

$strTemp = "Hello, I am a fish and you are not.";
$strTemp = CropSentence($strTemp, 16, "..."); 
print $strTemp;
?>
FireNet 64 Posting Whiz in Training

You could try factory methods:
http://en.wikipedia.org/wiki/Abstract_factory

For a game you could have an array/vector like
std::vector<bcAbility> hero_ability;

The base ability class

class bcAbility
{
 string AbilityName()
 void Do()
}

Having a factory class would allow addition/removal/modification of any number of abilities. Actual abilities would be derivatives of the base ability class and the factory class would take care of the initialization. This is a rough explanation, but this method's been in use for a while.


Factory Class Info (search)
Why Pluggable Factories Rock My Multiplayer World

http://www.gamedev.net/reference/articles/article2097.asp
http://www.gamedev.net/reference/articles/article1415.asp

FireNet 64 Posting Whiz in Training

Let me warn you .... modding is not the way to go if you have no previous experiance with game programming. Sure, you will be able to get some fancy effects to the screen, but mostly you would be just twiddling with settings... and that's not really making a game.

But the choice is yours so:
Content: http://gpwiki.org/index.php/Tools:Content
Programming : http://gpwiki.org/index.php/Tools:Programming

Also checkout the documentation for the SDK that came with the game.


I would recommed you start with some really simple games like pong or tetris. You will learn a lot during the process.

I did my first game with minimal knowledge using DOS graphics in about 2 weeks. It was a snake clone (I never did get around to doing a text game). It's not very hard.. and then you can move to higher level games quickly once you have an understanding of the basics.

Not to say modding is not game development, I've seen a lot of mods that really are good and do significant changes to game play. But I still hold playing with settings and art of a game is not really game development.

Have fun ^.--

FireNet 64 Posting Whiz in Training

Are you including stdlib.h in your source? or you could try using the delay() function...

win16 version? what sort of comp are you using?

FireNet 64 Posting Whiz in Training

Ok,meabed why dont you write a YourDoom virus,just kidding ;)

The Hello world program might have been the most important C++ for must.My first one said "This is COOL, I will conquer it".And I can say I am well on my way. ;).

Also ICEBAZOOKA.cpp was fun too.Start your comp,a small guy appears,takes out a tiny bazooka,tries to lift it,cant fall,you laugh,he fires,00000000wwwwww a small bullet which grows larger comes to you,hit the screen,bang,all the icons & screens look frozen, touch your mouse and you will find everything has frozen.Look for the little creep,he's gone.

FireNet 64 Posting Whiz in Training

FrozenICE.cpp to BurningHell.cpp

Hey,what else did you expect anyway.Cool depend on you.;)

FireNet 64 Posting Whiz in Training

Yea,using #include <iostream> is now the latest standard.

namespaces are something like a sealed off area of code,out side which you can use the same names with out conflicting with the name in the namespace scope.

You can also access namespace vars like namespace::std, std::cout

Have fun,ALSO learn to use the Standard Template Library (STL)

FireNet 64 Posting Whiz in Training

*Yawn*, me too.Who cares ???.We will have to use what ever the policy making companies shove at us.Yup it's quite too the OpenSource is only open before money comes in.It's like water,can dissolve anything given enough time.Brrr

<b>Resistance is futile.</b>

Nah......,You can do that till you are dead :D,and even then you can leave followers to do your work.

So after you are gone,what do you care :D .

FireNet 64 Posting Whiz in Training

Hello my poor c++ programmers
strcmp take two argument of type char * i.e array of character not char
i.e you can compare between
char *p = "SADDAM",l= "BOOSH";
cout << strcmp(p,l);
i hope you understand this thing

What makes you so rich abu_sager?
:!:

FireNet 64 Posting Whiz in Training

Good, well next time try doing the checking first Ok