14 Replies - 3125 Views - Last Post: 20 March 2006 - 07:29 AM Rate Topic: -----

#1 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

C with Graphics

Posted 27 February 2006 - 01:43 AM

Hello to all the dream in code members...

This time i have some codes with c and graphics...There are four programs.I tried to compile three of them (ie 1 ,2 and 4 program),But all the three are with some errors and warnings


In the first program[/COLOR]: I get so many warnings and an error as "d://backup//arung not found".I am not able to understand the code in full.If possible kindly help me to rectify the program.

(Please explain me with words each and every statement)I hope that will help me to solve the program.I dont say that all u have to do.But please explain me each and every statement thats enough.I will do the rest.


In the second program too i have some errors

In the fourth program i have an error as "tvlib not found" , here i dont understand what is "tvlib" because i am familiar with "tlib" but what is "tvlib" ???I think there is nothing like tvlib.Please help me with this too.


Any one who knows the solution or explanetion for any one program , then that doesn't matter , i will be really thanfull to the if they help me.


NOTE : All the four programs in the attachment.....

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: C with Graphics

#2 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: C with Graphics

Posted 27 February 2006 - 02:31 PM

well in program two:
#include <c:\arung\head.h>



That statment tells the the compiler to look for file "head.h" in directory C:\arung

And im guessing you do not have the file there, so the compiler gives you an error, and tells you it cannot find it. What you have to do is create a directory in your C: drive called "arung" and put the file "head.h" there, or if you have the file in another director replace the directory in the statement above. Or if it is in the same directory as the rest of the files, then just put:
#include "head.h"


this tells the compiler that the file is found in the same directory as the file you are compiling.
I've no idea about the tvlib, but im guessing its a library that you have not linked to your project.

Same goes for the first program.

I hope this helps
Was This Post Helpful? 0
  • +
  • -

#3 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Post icon  Posted 28 February 2006 - 05:20 AM

Thank u sir.........
Was This Post Helpful? 0
  • +
  • -

#4 im@geek  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 94
  • Joined: 18-February 05

Re: C with Graphics

Posted 01 March 2006 - 03:31 PM

I can not seem to find a functional copy of the graphics.h file could somebody send it to me?

timsmith23@mac.com

Thanks
Was This Post Helpful? 0
  • +
  • -

#5 Voodoo Doll  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 12
  • View blog
  • Posts: 108
  • Joined: 24-January 06

Re: C with Graphics

Posted 01 March 2006 - 04:14 PM

If you don't have it then sending it won't do you any good. The .h file only holds declarations, but for everything to work you need the library that goes with the .h file. The bad news is that the library is compiler specific, so if your compiler doesn't support it, nothing will work. And if your compiler supported graphics.h, you would already have it... :(

To add insult to injury, graphics.h is an old DOS header that you shouldn't be learning in the first place. There are better options out there these days like SDL or DirectX. I heard Allegro is good for first learning too.
Was This Post Helpful? 0
  • +
  • -

#6 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Post icon  Posted 05 March 2006 - 05:36 AM

Hi to all.... :rolleyes:

I have a problem here with graphics. I have done many programs with c & graphics but though it is errorless it isn't working.Then i tried to look for the bgi file...all the bgi files are in zip form. But while extracting those files there is a display message saying..

"ARC extraction not installed in Option/Configuration/Program location dialog box"

In the bgi zip there are files of following extensions :

.bgi, .chr, .c and bgiobg.exe too.....

Is that because of this my program is not working????What should i do??

Please help me quickly....

Thank uuuu.

:)
Was This Post Helpful? 0
  • +
  • -

#7 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: C with Graphics

Posted 05 March 2006 - 10:00 AM

I would be guessing its a corrupt archive.
Was This Post Helpful? 0
  • +
  • -

#8 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Post icon  Posted 06 March 2006 - 05:18 AM

Can u suggets me what to do further?????????????
Was This Post Helpful? 0
  • +
  • -

#9 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Post icon  Posted 12 March 2006 - 09:46 PM

Hello to all.....
Can any one help me to clear my doubts??? The doubt is on some program statements that i had already sent as attachments.To show it specifically ,i am displaying some here.....

" What does the notations ax,bx,cx,dx...........and al,ah,bl,bh,cl,ch,dl,dh...mean ?????"

While searching for this i found it is used for Byte And Word Registers and linked to union REGS. I even know that these are for cursor positions but not quiet clear with how it works and for what ax,bx,...or al,ah......are used.

Please help me with these.

THANK U :blink:
Was This Post Helpful? 0
  • +
  • -

#10 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: C with Graphics

Posted 13 March 2006 - 07:54 PM

Well here:
http://cplus.about.c...bldef_union.htm
http://msdn.microsof...ngref_union.asp

basicly an union is like a structure except it only allocates enough memory for the largest object in it. And it shares all that memory with all of the members, so you can really work with one member at a time.

In my opinion this is kind of pointless, but I would see why it would be done, I personally suggest just using normal structures or classes.


but in the case in teh files you provided.

ii and oo are unions of structures of REGS, which seems to contain structures in it.

so its like accessing the member of a structure inside a structure.

Much like this:

class T1
{
int ah;
};
class T2
{
T1 h;
}

int main()
{
T2 ii;

ii.h.ah = 2;

return 0;
}
//That is basicly what they've done.
//except that ii in your case is a union.

Was This Post Helpful? 0
  • +
  • -

#11 poke_blade  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 26-February 06

Re: C with Graphics

Posted 17 March 2006 - 07:48 AM

These ax,ah... and all others are mainly used in calling interrupts.
(I hope you know what is interrupt).
These ax,bx are nothing but the emulated registers of the actual 8086 processer.
You might have heard that turbo c/c++ which we are dealing with work under protected mode.
Which means that actual intel pentium 4 procesor is
converted(i.e emulated) into 8086 procesor.Which makes us work very slow in explorer if there is a turbo compiler open.
So when it is emulated it assumes some of actual pentium register as ax,bx,cx,dx etc....Which are there in the union
Was This Post Helpful? 0
  • +
  • -

#12 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Posted 18 March 2006 - 12:46 AM

THANK UUU....
I still have a doubt....

The doubt is dealing with the same program.The progarm i have attached and i have shown the doubt area as a comment.Kindly clear it.

The first half of the program is clear but after...
[CODE]

if((kbhit())
{ii.oo.ah;
int86(22,&ii,&oo);
m=oo.h.ah;
}
Here i am not able to understand ...
1 ) " What value will be returned to m?"
2) "what does 22 do here?"

Then futher in this program there are

[CODE]

if(m==77) or 80 or 75 etc

1) Here how does the value of m change?

Unless i get clear with the value returned to m i remain puzzled with the second half of the program where all the movement of the game is dealt with.

Kindly Expalin me....Clear my doubt the rest i will manage...

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#13 poke_blade  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 26-February 06

Re: C with Graphics

Posted 18 March 2006 - 11:13 AM

Ohh..this one is easy.
22 is the interrupt number for keyboard.i.e.when occures it returns the scan code of the key which has been pressed.
the ah part of the register has the scan code.Which you are storing in m.
The key value m is 75 for left
m is 77 for right
m is 80 for up
m is 72 for down(i think soo cause i dont remeber it properly)
-------------------------------------
These are some of the importent uses of interrupt 22(i.e 0x16)
[i.e 16 in hexadecimal system is equivalent to 22 in decimal.]
------------------------------------
Read Next Keyboard Character
Interrupt 0x16
Input AH = 0x00
Returns AH = scan code
AL = ASCII code




Report Whether Character Ready
Interrupt 0x16
Input AH = 0x01
Returns zero flag = 0 - character available to be received,
1 - no character in keyboard buffer
AH = scan code
AL = ASCII code




Get shift status
Interrupt 0x16
Input AH = 0x02
Returns AL shift status bits

Notes Shift status bits are
Bit 0 = 1 : Right shift depressed

Bit 1 = 1 : Left shift depressed

Bit 2 = 1 : Ctrl depressed

Bit 3 = 1 : Alt depressed

Bit 4 = 1 : Scroll Lock on

Bit 5 = 1 : Num Lock on

Bit 6 = 1 : Caps Lock on

Bit 7 = 1 : Insert on
Was This Post Helpful? 0
  • +
  • -

#14 symanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 18-February 06

Re: C with Graphics

Post icon  Posted 19 March 2006 - 11:53 PM

THANK U SIR/MADAM,

As i had no reference books for graphics and also as i was newly learning graphics, i had so many doubts. This part is clear...if any i will ask more.
Anyway after many days i have seen an Indian member into this site. Happy to have u here. Thank u for clearing my long awaited Questions.

:genius:
:D
Was This Post Helpful? 0
  • +
  • -

#15 poke_blade  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 26-February 06

Re: C with Graphics

Posted 20 March 2006 - 07:29 AM

If you want to know the scan codes or ascii codes of any key on your keybord just use this program

Attached File(s)

  • Attached File  KEY.COM (8.31K)
    Number of downloads: 7

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1