rahul8590 71 Posting Whiz

well just making an ecyption system based on existing cipher is like re inventing the wheel , so it would be better to innovate something at thesis level . well thats my speculation

rahul8590 71 Posting Whiz

DargonFire SDK ... hmmm thats not something which i have worked on before .
Well sometimes its not just the c++ coding but also the SDK taking control of the screen. I am not sure of that , but i can tell you out of my experience with openGL .
well i am sure that DF SDK will also have some APIs for displaying text . It would be prudent to use those APIs for rendering text rather than cout statements .

rahul8590 71 Posting Whiz

>If that isn't possible than I'll just forget it.
Well certainly thats possible .

well i dont know how your game is designed , but i faced an analogus problem in the past , where in the data was actually being printed , but i was also coming out of program immediate which made me unable to see the output.
so , i guess if you could ask the user to hit enter ( or any other character ) to exit the game or something similar , ur last output will still stay on the screen.

tiger86 commented: Very nice and helpful. +3
rahul8590 71 Posting Whiz

well i would recommend advanced number theory for encryption , since encryption involves more of math than computer science .

rahul8590 71 Posting Whiz

chuck that damn compiler ..... its totally totally obsolete .
and btw it doesnt matter , because the tubro Cpp (SCHOOL programs ) programs will also run with gcc and MinGW , although there might be some finer nuances .. like using namespaces etc the other 2 are better than turbo cpp :P

rahul8590 71 Posting Whiz

well ... i am kida baffled .
i guess u want to print the counter which increments by one .

all u gotto check is the variable assg shouldnt exceed the max points you set .
and while thats true , keep incrementing the counter .

rahul8590 71 Posting Whiz

Its an integer array pal .
The right way to print is to put it inside a for/while loop .

for ( int i= 0;i <12 ; i++)
cout<< list[i];
LeoC++ commented: :-) thanks learnt something tonight!! +0
rahul8590 71 Posting Whiz

technically speaking map is a STL ( structured template library ) . There are many tutorials in net which teaches you about its usage.
I can provide u the complete code , cuz u will not learn anything . If you get stuck somewhere in this process , i might bail you out.

rahul8590 71 Posting Whiz

its very simple ..
I guess u are not aware of map data structure.
Basically , when ur getting the character from the file , check it using a map and then the equivalent to that may be printed or stored in a file according to ur wish.

this is the simple code on how to use a map data structure .

map<char,int> mymap;
map<char,int>::iterator it;

mymap['a'] = 0;
 mymap['b'] = 1;
 mymap['c'] = 2;
 mymap['d'] = 3;
 mymap['e'] = 4;
 mymap['f'] = 5; 


do
{
for ( it=mymap.begin() ; it != mymap.end(); it++ )

    {
        if( s[i] == (*it).first )        // s[i] holds the plain text which is     
        {                                     //mapped  to the 1st element of map
            enc[i++] = (*it).second;    // if it matches then the equivalent is 
            len--;                                // is stored in ur enc[] which is the 
          }                                    //encrypted array

    }
} while (len != 0);

The above is not the complete code , but gives u fair idea on how to use maps for your encryption.

Also google more on maps for its usage.

rahul8590 71 Posting Whiz

well .. u could have posted the code in here using the code tags ..
Besides , its would be prudent to enunciate your problem , or else its difficult to find help in here.

rahul8590 71 Posting Whiz

As Waltp said , u gotto create a new file with .h extension and then transfer the complete class code into it .
In the main program call

#include "counter.h"

and then create the class object to use all the methods inside it.

rahul8590 71 Posting Whiz

well then u gotto to be a little specific here ,
AS far as i guess , ur saying ur not able to run graphic program
the possible reasons could be

1. there is no graphic lib
2. There exist graphic lib but , its not linked to

Notepad++ is a code editor thats all , its got nothing to do with ur graphics not running,

rahul8590 71 Posting Whiz
rahul8590 71 Posting Whiz

Well for graphic programming there are 2 major tools (well not exactly tool)

1. OpenGL
2.DirectX

Since u want windows oriented ,it would be prudent to go with DirectX .

This will get u started.

http://www.two-kings.de/tutorials/dxgraphics/

rahul8590 71 Posting Whiz

>4 and 7 is also prime number but it is not in the output..

1. 4 Cannot be a prime number .

2. At line 34 , there is no need or resetting it to true .

3. At line 19 interate the "i" from 1 to n

I guess this should solve ur problem .

An improvised version of ur code

for (i=1;i<=n;i++)
   {
        prime=true;

        for (j=2;j<i;j++)
        {
            if (!(i%j))
            prime=false;
        }   
        if(prime)
        cout<<i<<endl;

    }
rahul8590 71 Posting Whiz

Well , i am not sure of a API whether i exist or not and even if there exist an API , the purpose will not completely be fulfilled .

For example :
Even if u write a program which doesnt allow to access internet after a time , the user can use other programs or tools to bypass it .

Although there is a way that can implement wat u asked and that is installing a proxy server in ur system .
i have myself done that in my college for regulating the internet access in each departments .
SQUID proxy server allows u to perform many functions like that.
Not only u can create a ACL (access control list ) but also assign user groups and set their time of access and other attributes.

rahul8590 71 Posting Whiz

Well in that case , i would need to know what exactly ur trying to achieve ?

As far as i can see is that , this is a mere part of ur project or wat ever . it would be better if u could give a panaromic view on wat r u trying to do ., then it will be easier for all of us here to help u out.

rahul8590 71 Posting Whiz

in ur turbo c== compiler , u can navigate to help (right mouse click) and then search for inp() and outp() .
There u will not only get a decent explanation but also an example with it.
I guess that would help u out.

rahul8590 71 Posting Whiz

i guess u didnt understand my code..... why dont you execute this code and see how exactly it works.......
and variable can also be put inside instead of boolean, any way 1= TRUE and and 0 or lesser implies false.......

and if you have observed the original code.. it doesnt have ne room for allowing the user to exit..
if he./she presses the wrong number , its just wants to accept the new number .. so where the h@#l the user will exit............

rahul8590 71 Posting Whiz

flag is a variable name .. u can also write ur name instead of that.. its just that i am a bit convenient with that name that's its.....
and i am also giving an option in switch case if the user wants to exit.
both the way it works.....

rahul8590 71 Posting Whiz

actually u can use a flag......(its just a variable but commonly know as flag when used in such purposes )

void display( )
{  
	int option, int flag =1;
	system("cls"); //clear screen
	cout<<endl<<endl;
	cout<<"\t  * Display Menu *\n";
	cout<<"\n\t1. Display For Certein Date"<<endl; 
	cout<<"\t2. Display All Appointments"<<endl;
	cout<<"\t3.  exit"<<endl;
	cout<<"\nEnter Option Number: ";  //Enter option
	cin>>option;
	cin.get();
    while(flag)
	{   
        switch ( option ) 
        {
            case 1: displayCerteinDate ( );
                    break;
            case 2: displayAll ( );
		             break;
            case 3: flag =0;
                     break;
            default: cout<<endl<<"Wrong option number!! Try again\n";
                    cin.get();         //give the user a chance to read the output data
	  }
	}

}

i have intialised a variable flag to 1 . and put the whole swicth inside a while loop which check for the status of the flag.
i have included an exit option in the menu . so as soon as the user presses 3. the flag =0 and the while condition fails , eventually u will come out of the loop and program ends

tux4life commented: That's not real programming +0
rahul8590 71 Posting Whiz

Yes I have already mentioned that k2k can run their program as an applet. Do you know of any way that a java application (ie not an applet) can be run from an HTML link?

well actually i used to convert all of my code in an applet form and work. but if u completely wanna run java application using html then try the underneath link .
http://www.java2html.com/
it converts the java code to html .

does it mean my main html file should have a link, linking to another "html file in java format" and must extend to applet?

if it doesn't take too long, would you mind to give a simple example of the java program? maybe just the necessary heading and stuffs, so it would be easier for me to see the first time doing this.

well i cannot write a complete program , but yeah since you have requested i can write a simple one.

import java.awt.*;
import java.applet.*;
/* <applet code = "me" height = 300 width = 300 >
</applet code> */
public class me extends applet 
{
public void paint (Graphics g)
{
 g.drawString("hi",25,25);
}
}

well honestly i havent compiled the code , but to the best of my knowledge it must work .

rahul8590 71 Posting Whiz

well in ur java program u will have to write the following

/* <applet code = "filename"  height = 300 width = 300 >
   </applet code> */

it should be written after the packages you import (i usually write at that position ). you can change height and width accordingly.
and you have to write like writing comments cuz java compiler doesnt understand that particular tagged code

and then save the file in .html form . i guess it should work
or else in the command mode you can use appletviewer

rahul8590 71 Posting Whiz
rahul8590 71 Posting Whiz

well if ur a neophyte into this then the oly thing i recommend is ti do the program from basic
1. using char array . later on you can re do the same thing with utmost sophistication . sometimes simplicity is the best thing .

rahul8590 71 Posting Whiz

char[] characters = Text.toCharArray();

wat is "text" here , i mean wat does it hold .
besides u could have been a little more explicit in mentioning about your code .

as far as i guess from this its a mismatch between string and char data type .
why dont u first try keeping all the data type as same preferably char and then solve it , ur job will be a lot more easier n then you can go ahead doing using string n char types .

rahul8590 71 Posting Whiz

well let me simply for you ..

1. accept number(`s in form of for loop or so ) and perfrom step 1 of my previous post .
you will land up with alll the divisors of that particular number (which will be the current number of for loop ) .
store it in some kinda array .

2. now check the summation of these numbers (which are divisors of the number inputted). if the add up to the number which is inputted , then the number which is inputted is perfect .

now re run the for loop and find such first 4 perfect numbers

rahul8590 71 Posting Whiz

sorry for late reply

Errr... I have installed TASM, but i got no idea how to work with it.

well if u have done a conventional installation that is installing in c drive. there must be a folder called TASM must be created
most imp searchfor two files mainly
1. tasm
2.tlink

these are the basic files (well a lot more are needed ) .

well to work with tasm its very simple

1. create (.asm) file and write ur assembly code
2. tasm filename.asm (type this in dos)
it will create an (.obj) file provided if there arent any errors .
if errors exist it will tell with the line numbers

3. tlink filename.obj
this will create an exe version of the file

4.filename thats it , since its exe it will excecute itself

i guess this should do , if something un usual happens let me know

rahul8590 71 Posting Whiz

well did u try that in tasm ....? that is the turbo assembler . (its kinda preferred )

rahul8590 71 Posting Whiz

well why dont you try tasm (mostly doesnt disappoint ) .
besides why dont u try the following code

.model small
.stack
.data
       str  db "Welcome to assembly $"
.code
          mov ax , @data
          mov ds , ax     ; gets data to data segment
          lea dx , str      ; laods effictive address of str in dx reg
          mov  ah , 09h  ; calls for display
          int 21h
          mov ah , 4ch   ; ends sub - routine 
          int 21h
end

i wold like to know whether this program works o your system or not its just a simple program to display the string content

rahul8590 71 Posting Whiz

I have a question I did not understand if anyone of you understood it please explain to me

suppose that m and n are integers and m is nonzero. Recall that m is called a divisor of n if n=mt for some integer t; that is, when m divides n, the remainder is 0. moreover .m is called a proper divisor of n if m<n and m divides n. a positive integer is called perfect if it is the sum of its positive proper divisors. for example, the positive proper divisors of 28 are 1,2,4,7 and 14 and 1+2+4+7=28. therefore 28 is perfect. write a program that does the following;
a.output the first four perfect integers.
b.takes as input a positive integer and then outputs whether the integer is perfect.

and thank you a lot

well ur inputted with a number for ex lets take the no 28 ( which is in ur ex)
1. (this one is for proper divisor )
u will have to find such nos that divide 28 completely i.e
28 % number = = 0
the remainder must be zero
thus you will land up in 1 , 2, 4, 7 , 14

2. then when u find these numbers , u will have to find the summation of these in such a manner that
their sum is equal to 28
i.e in this case 1+2+4+7+14 = 28

thus the number 28 becomes perfect positive number .

rahul8590 71 Posting Whiz

I am having a lot of trouble trying to get the toUpperCase method working. I have basically put a String of text into a character array and I want to convert a certain character in a certain place in the String to uppercase.

well i doubt that u can do that simultaneously . well if u want to find a particular character and then replace or replace at particular position .

1. input the string
string s = new string ("text");

2.convert the string to char array
char s1[] = new char[4];
s1 = s.toCharArray();

3. iterate using the character array and change the character u want to

4. covert the character to string
s = s1.toString();

then i guess u can re print the string.

rahul8590 71 Posting Whiz

well even i am into image processing and this link helpmed me a lot .
i dont know how far it will help you .
http://cimg.sourceforge.net/

rahul8590 71 Posting Whiz

Well the best book as far as i have know is
Assembly language step by step - jeff duntemann
he teaches you from the scratch.
well after reading the whole book if u still want to develop more insight into it , then i guess u can go in for
Mastering Turbo Assembler by - Tom Swan

these r the ones i liked the most.

rahul8590 71 Posting Whiz

well at the first place i would recommend usage of float data type instead on double , guess float would do the trick.
second of all subtract the left part of the no from the original no itself , by doin this u can isolate the decimal part and then if u r looking for a 3 decimal round off in all the nos ( which apparently is ) .
u can multiply the 3 digits decimal into 100 and then round of them

float round( float no )
{
     int x, temp;
     float y;
     temp = x = no ;   only the integer part is taken 
     y = no -  x ; u get the decimal number here 
     y*=100 ; decimal gets converted to 2 digit no n 1 decimal
     x = y;
     y-= x;  the last decimal is stored in y 
     if( y > = 0.5 )
             x++ ;
    return (temp + x/100) ;
}

well i would like you to dry run the code .

songweaver commented: very helpful +1
rahul8590 71 Posting Whiz

Well correct me if i am wrong .
asser macro aborts from the program not exits . there is a subtle difference btw them . the former i guess exits without performing any task . but the latter i guess has a safer exit.


well if u want to abstain ur self from exit i guess u can turn ur code something like this

int cmp (int a , int b)
{
     return(a!=b);
}

and in main function
if(cmp(a,b))
      cout<<"both r not equal";

i guess this should work

rahul8590 71 Posting Whiz

Well assert is a macro that expands to if statement .
if the test value is zero assert prints the message to stderr:

if the test fails :
test , filename , line linenum is printed .
linenum is the line where the macro is used

well it depends on a persons usage that were exactly he has to use.
if u want to check some no (which might be a passwd) then use assert function . cuz if it fails the program is aborted.
but u want to perform conventional check then its prudent to use the if statements .

rahul8590 71 Posting Whiz

fine then by freeing the first node . we can delete the complete list .

rahul8590 71 Posting Whiz

Well at the first place . When the program run is over the OS itself deletes the linked list . so actually no need of deleting it using a destructor.

if u want to delete a link list all you have to do is free the first node of the list thats it .
if u have allocated the node using mallloc/calloc function then you can use free function to free the node or else
if you have new operator then you can use delete operator to fee the node.