473,465 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

i got some eror like "not a member" "parameter is never used" "undefined symbol" any

1 New Member
#include <iostream.h>
#include <conio.h>

typedef int absis;
typedef int ordinat;

//Structure Poin & Garis
struct Poin
{
absis x;
ordinat Y;
};


struct Garis
{
Poin A;
Poin B;
};

#define absis(P) (P).x
#define ordinat(P) (P).y
#define ax(G) (G).A.x
#define ay(G) (G).A.y
#define bx(G) (G).B.x
#define by(G) (G).B.y

Poin CreatePoin(absis x, ordinat y);
void MovePoin(Poin *P,absis x,ordinat y);
Garis CreateGaris(Poin *P1, Poin *P2);
void CetakGaris(Garis G);

int main()
{
Poin P1,P2;
Garis G;

P1=CreatePoin(3,6);
P2=CreatePoin(9,4);

cout<<"Cetak Titik Garis";
G=CreateGaris(&P1,&P2);
CetakGaris(G);

getch();
clrscr();
cout<<"Posisi Titik Garis Berpindah";
MovePoin(&G.A,3,4);
MovePoin(&G.B,-3,-1);
CetakGaris(G);
getch();

return 0;
}

poin CreatePoin(absis x, ordinat y)
{
Poin P;
absis(P)=x;
ordinat(P)=y;
return P;
}

void MovePoin(Poin *P,absis x,ordinat y)
{
absis(*P)+=x;
ordinat(*P)|=y;
}

Garis CreateGaris(Poin *P1, Poin *P2)
{
Garis G;
G.A=*P1;
G.B=*P2;
return G;
}

void CetakGaris(Garis G)
{
gotoxy(ax(G),ay(G));cout<<"*";
gotoxy(bx(C),by(G)); cout<<"*";
}
Mar 19 '17 #1
1 1059
weaknessforcats
9,208 Recognized Expert Moderator Expert
This code:

Expand|Select|Wrap|Line Numbers
  1. poin CreatePoin(absis x, ordinat y)
  2. {
  3.     Poin P;
  4.     absis(P) = x;
  5.     ordinat(P) = y;
  6.     return
  7. etc...
fails because it is incorrectly coded. absis and ordinat are types of int. So absis(P) is the same as int(P), which makes no sense.

What you intend is to place values in the x and y members of the variable P. So your code should look like:
Expand|Select|Wrap|Line Numbers
  1. poin CreatePoin(absis x, ordinat y)
  2. {
  3.     Poin P;
  4.     //absis(P) = x;
  5.     //ordinat(P) = y;
  6.     P.x = x;
  7.     P.Y = y;
  8.     return P;
  9. }
  10.  
You will need to make this fix in several places.
Mar 19 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
1
by: Justin Dutoit | last post by:
Hello. I'm practising some custom authentication for web services, and I get the error-' BC32035 Attribute specifier is not a complete statement. Use a line continuation to apply the attribute...
2
by: Kenneth P | last post by:
Hi, This is perhaps not the right forum to discuss this matter but it's about the sample library of VS.NET2003. I have a swedish OS Windows 2000 Professional and accordingly all messages are...
12
by: yuyazhang | last post by:
Hi , I am a graduate , I have had some basic knowlege about C++ ! but I find that I can't master it , I am disappoint for that . who give me some advice about ways which master it and some...
4
by: Steve | last post by:
I have read a couple articles online, read my Jesse Liberty book but I am still confused as to just what the best practices are for using exceptions. I keep changing how I'm working with them and...
0
by: wellingj | last post by:
A little back ground on what I'm trying to do: I'm making a generic weighted graph class (vertexes and edges althought I don't call them that) to implement some pathfinding algorithms like A* and D*....
5
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Been a long time since I dealt with some Bit-Wise operations - and never did so in C#. Can someone help me with the following, simple example and how to work with each of my situations (listed...
4
by: Ed Mullen | last post by:
Windows XP, I've downloaded the msi installer (PHP 5.2.5 installer - 08 November 2007) from three different mirrors, MD5 is ok. The installation fails with error 2878. Any ideas? -- Ed...
6
by: phpmagesh | last post by:
Hi I am creating login page with validation. i have index.php page with login box, for validating this login detail i m redirecting to login_validate.php. Login_validate.php file code: ...
2
by: ChristianBurn | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8"...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
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...
0
tracyyun
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...
0
agi2029
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 projectplanning, coding, testing,...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.