You should #include "ccc_win.h" library which you have to download.
Here is a sample code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
int ccc_win_main()
int ccc_win_main()
{ Point p(1, 3);
Point a = b;
Point r = b;
a.move(0, 1);
r.move(1, 0);
Line s(b, a);
Line t(b, r);
cwin << s << t;
s.move(1, 0);
t.move(0, 1);
cwin << s << t;
return 0;
}
I am not sure if it will compile there may be a small mistake like a missed ";" or sth because i dont have the ccc_win lib now.
But thats the way.
you can create points
- Point p(1, 3)
move lines
-a.move(0, 1)
create circles :
Point p(1,3);
cwin << p << Circle(p,2.5);
where p are the coordinates and 2.5 is the radius.
you can type messages
-Point p(1,3);
Message greeting(p, "Hello, Window!");
cwin << greeting;
and so on.
Edit:You can also use the get.mouse function
- Point center = cwin.get_mouse("Enter the center of the circle:");
The program prompts the user to click on the console, and thats the senter of the circle.You may use that not only for center of the circle!
I think you got the idea.
Good luck
If you are using Dev c++ you add the library when you click on project>>add to project>>(path to the ccc_win.h)add ccc_win.h, or there will be an error -
ccc_win.h - no such file or directory !!!
what is the (path to the ccc_win.h)?
i saved dev C++ in default area (C:\\pragram files\\Devc++", but it contains a whole bunch of folders and files and i cant find the ccc_win.h file
what is the (path to the ccc_win.h)?
i saved dev C++ in default area (C:\\pragram files\\Devc++", but it contains a whole bunch of folders and files and i cant find the ccc_win.h file
I told you to download ccc_win.h
Its not in dev-c++ .
Why its much much harder.If he add to the project ccc_win and write the code, there appears the white screen and you just click on it.Isnt it the same?
if he is using something that is an object that the linker can't find, then it will be a problem.. Here are the full instructions for the Horstmann Code Libraries...