KUMARACC.C
---------- - #include<stdio.h>
-
#include<dos.h>
-
#include<conio.h>
-
#include "d:\kumaracc\button.c"
-
#include "d:\kumaracc\hvline.c"
-
#include "d:\kumaracc\label.c"
-
#include "d:\kumaracc\rect.c"
-
#include "d:\kumaracc\rmbutton.c"
-
#include "d:\kumaracc\textbox.c"
-
-
# define ALT_A 7680
-
# define ALT_L 9728
-
# define ALT_X 11520
-
void main(){
-
int key,c;
-
do{
-
clrscr();
-
printf("Enter choice\n");
-
printf("\n1. hvline\n2. label\n3. rect\n4. rmbutton\n5. textbox\n7. button\n6. Exit\n");
-
scanf("%d",&c);
-
switch(c){
-
case 1 : hline(10,10,20,'*');
-
vline(10,12,22,'*');
-
getch();
-
break;
-
case 2 : label(10,10,3,4,"DBList");
-
getch();
-
break;
-
case 3 : rect(10,10,30,12,'*','|');
-
getch();
-
break;
-
case 4 : rmbutton(10,10);
-
getch();
-
break;
-
case 5 : textbox(10,10,30);
-
getch();
-
break;
-
case 7 : button(10,10,"Open");
-
getch();
-
break;
-
case 6 : exit(0);
-
}
-
}while(1);
-
}
-
-
-
HVLINE.C
-
--------
-
-
// LS = LineSymbol
-
int i;
-
void hline(int x,int y,int x1,char LS){
-
for(i=x;i<=x1;i++){
-
gotoxy(i,y);
-
printf("%c",LS);
-
}
-
}
-
void vline(int x,int y,int y1,char LS){
-
for(i=y;i<=y1;i++){
-
gotoxy(x,i);
-
printf("%c",LS);
-
}
-
}
-
-
-
RECT.C
-
------
-
-
// LS = Line Symbol
-
void rect(int x,int y,int x1,int y1,char LS,char LS1){
-
hline(x,y,x1,LS);
-
hline(x,y1,x1,LS);
-
vline(x,y+1,y1-1,LS1);
-
vline(x1,y+1,y1-1,LS1);
-
}
-
-
BUTTON.C
-
--------
-
-
//CL = Character Length
-
void button(int x,int y,char *Caption){
-
int CL;
-
CL=strlen(Caption);
-
rect(x,y-1,x+CL+3,y+1,'*','*');
-
gotoxy(x+2,y);
-
printf("%s",Caption);
-
}
-
-
-
TEXTBOX.C
-
---------
-
-
// ML = Maximum Length
-
void textbox(int x,int y,int ML){
-
rect(x,y,x+ML+1,y+2,'-','|');
-
}
-
-
RMBUTTON.C
-
----------
-
-
// rmbutton = Record Move Button
-
void rmbutton(int x,int y){
-
int i;
-
rect(x,y-1,x+16,y+1,'þ','þ');
-
for(i=x+4;i<=x+12;i=i+4){
-
gotoxy(i,y);
-
printf("þ");
-
}
-
gotoxy(x+2,y);
-
printf("F");
-
gotoxy(x+6,y);
-
printf("P");
-
gotoxy(x+10,y);
-
printf("N");
-
gotoxy(x+14,y);
-
printf("L");
-
}
2 2361
I don't get the error about a type mismatch for a redeclaration of rect in the code you posted.
However, this is not correct: -
#include "d:\kumaracc\button.c"
-
#include "d:\kumaracc\hvline.c"
-
#include "d:\kumaracc\label.c"
-
#include "d:\kumaracc\rect.c"
-
#include "d:\kumaracc\rmbutton.c"
-
#include "d:\kumaracc\textbox.c"
-
You do not include source code files in a source code file. This is the same as inserting a copy of the file itself. So if file A.c includes B.c and C.c and B.c also includes C.c you get redefinition errors because there are two copies of C.c and the code will never compile.
Instead you use a project to contain the source files and you use header files to declare functions leaving the linker the job of combining all the object files into your .exe.
You might want to read up on the C/C++ build process.
Do any of those other c files also include rect.c?
By the way, main() should return an int. You should not define it as returning void.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Arun Wadhawan |
last post by:
Hello
MY SQL Server is causing me this problem :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I am getting from...
|
by: LJgrnl |
last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData
has the initial value False. If a recordset comes back empty (both .EOF and
..BOF are true) then blnNoData is set to...
|
by: Mark |
last post by:
Hi - I tried this in VS.Net, and also in the Web Matrix code below: -
but I am getting a type mismatch error.
The sql statement runs perfectly from within the Access Query Designer.
Can anyone...
|
by: middletree |
last post by:
I've been messing with this for hours, and have been to various sites,
including Aaron's site, and am truly stumped.
The short version: in SQL Server, the 4 fields in question are datetime. I...
|
by: Mike |
last post by:
I am getting a type mismatch error when I do a bulk insert.
---Begin Error Msg---
Server: Msg 4864, Level 16, State 1, Line 1
Bulk insert data conversion error (type mismatch) for row 1, column...
|
by: shan |
last post by:
What is the meaning for the error expression syntax and type mismatch
error.I am using turbo c++.can anybody correct the errors in the
folowing program.
Following program is to find matrix...
|
by: Brett |
last post by:
I have a form that calls a method within a DLL. By clicking a button on the
form, the DLL is instantiated and the SaveOutlookMessage() method invoked.
The DLL code copies messages from Outlook to...
|
by: Howard Kaikow |
last post by:
I'm doing a VB 6 project in which I am trying to protect against type
mismatch errors.
Is the process any different in VB .NET?
Here's what I'm doing in VB 6.
I have an ActiveX DLL.
The...
|
by: Lysander |
last post by:
I have written a query that takes three integers representing day,month and year, forms a date from them and compares this date to the date the record was entered and returns any records where the...
|
by: crookward |
last post by:
I usually have no problem identifying a type mismatch error, but this one's got me pulling my hair out. The mismatch error is pointing to line 269, which is a blank line, and it's also within an if...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |