|
it least give him an idea or two to start with
|
|
|
|
|
1) prompt for and accept the day’s date
cout<<"Enter date";
cin>>date; (but before this u need to create a variable for date - i guess u already know that)
2) - initialise all the hours in the day to “free”
u can use a for loop for this.
and yes for 'hour' integer variable u need to create an int array.
3)- repeatedly prompt the user for an hour number
i don't understand.....repeatedly means what intervals it should follow?
4) - if the hour is “free” mark it as “booked”
use the if else construct for this
5)- otherwise tell the user “already booked”
same if then used as in 4)
6)- display the day and its appointments
in a for loop u need to use cout.
I hope that helps u?
Regards
|
|
|
|
|
Friends ! I need help !
I have to write a programme in C++ which can listen or sniff the serial port, but without opening the port. The sniffer and the programme which communicates through the serial port has to be on the same PC, I have to write a program which can read ( or listen ) the data that goes out and comes in from the serial port, BUT NOT TO OPEN THE PORT, to let communication programmes communicate through serial ports.
If anyone has an idea how to write this sniffer programme, please send me a advise.
Many thanks !
Szilard
SZ
-- modified at 6:08 Thursday 2nd March, 2006
|
|
|
|
|
Don't cross-post. Your question is C++ related so it has to stay on the Visual C++ forum, it doesn't belong to this forum (which is for managed).
|
|
|
|
|
Why do they have to be on the same PC?
If they really don't then make a cable that taps wires TX, RD and Ground (on a 25 pin I think that's 2 3 and 7). Hook the taped lines to the com port on the other machine and you can monitor the traffic.
|
|
|
|
|
there is a program that allows you to do just that, and it's free. That program is called: "PortMon" and it comes in a suite of moitoring software such as FileMon, RegMon etc.
----
www.muzikstor.com
|
|
|
|
|
Hi to everyone....I have an opengl application contains a 3-D shape where the user can rotate it,translate it e.g.... Well my problem is that i want to click on lines and points of this grafic and show details for that point or item....I think is called hit test!!!!!Does anyone knows how can i do that or show me a link in web telling me how to do that, or just give me some simple steps!!!!!
Thanks u for ur time!!!!
giotis
|
|
|
|
|
Uh. Well. I don't know how to realize with OpenGL, but if you want to know something about OpenGL http://nehe.gamedev.net/[^] is a much better place to look at. There should be a forum, too.
I only now how you could realize it programming it all on your own in C++. Then you have to project the 3D-Scene on a 2D-Matrix and you store which points (perhaps as a vector linetest) are corresponding to which object.
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
Thanks for ur response!!!!That was my first decide to convert the 3-D to
2-D Matrix, but i think is so difficult because the objects rotates and that mean that the coordinates must change!!! I find a way to make it with glLoadName[] argument.....where every line and spot will be an index in that matrix.......Do u know anything about that????
Thanks!!!!!!!!!
Giotis
giotis
|
|
|
|
|
No sorry. Yet I just did the rotation for myself and worked with the scene parallel to OpenGL (I wrote a "Level of Detail" appoximative collision detection for huge scene with a large amout of objects), so I just know the OpenGL basics and did the other work on my own.
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
There are several ways to do this. The "hit test" implies solid shapes, or triangles. This is because points and lines are one dimensional objects. A triangle has a 2D surface projected in a 3D environment, but when the surface is shown to the user, it occupies enough space on the screen to be selected and chosen. Although you can draw a triangle as a wire-frame, you will want to store the data as triangles rather than points or lines.
It seems there is even a Code Project article on it: http://www.codeproject.com/opengl/openglmousesellection.asp[^]
You can also save yourself the math in your 2D to 3D projection idea by using the glProject() and glUnProject() routines. By comparing the results with your mouse location you can do "nearest" operations which are a little more complicated since they imply distance operations.
You can shortcut some series, by using a culling sphere concept (center of object), and finding the overlapping cull spheres, by checking distance to center and radius of sphere to distance. When the chosen point is within the cull sphere, then and only then will you parse through the full object to find which point. You can also do similar operations with faces with center and range operations, though that will more likely take longer then applying other methods.
If you do a google search on "opengl picking" or "opengl mouse picking" you will find lots on the subject from various sources.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-- modified at 16:13 Thursday 2nd March, 2006
|
|
|
|
|
Jeffry J. Brickley wrote: The "hit test" implies solid shapes, or triangles. This is because points and lines are one dimensional objects.
No it doesn't. You can develop a hit test for lines too. Just make a line a little bit thicker when projecting it to your textmatrix (just anti-aliasing but with non different values). This works properly good.
Greetings,
Ingo
------------------------------
PROST Roleplaying Game
|
|
|
|
|
ihoecken wrote: No it doesn't. You can develop a hit test for lines too. Just make a line a little bit thicker when projecting it to your textmatrix (just anti-aliasing but with non different values). This works properly good.
Actually I had forgotten about a method that allows you to pick any shape, any line or point in multiple objects easily, without lifting a single matrix.... It was presented at one of the conferences I went to, but I forget which one.
Given that you can do "off screen rendering" to pbuffers, simply color every object you want to choose slightly different. Given 24bit color that gives you 16777216 distinguishable values when anti-alias is not used (in this case also turn off transparency and any other possible mixing values). Now render the image into a pbuffer and compare the color value to where your mouse is pointed, instant table lookup to the object you want whether it be line or point. It's fast, reliable, requires no CPU overhead and can be cut in only during a mouse-press so that it occupies a single frame overhead (actually less since it never actually has to be copied to the screen).
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I was storing app settings in the registry, but I figured I would update to the new dangfangled app.config way. I tried it out, but when I compile, no app config file is copied into my output directories. It seems to work fine if I manually copy it and name it appropriately. Does anybody know if there is a setting somewhere that will automatically copy it when compiled...or is this another c++ deficiency?
|
|
|
|
|
Visual Studio 2005 (C++/CLI):
As far as I know, it does not set it up to do it for you automaticallly.
1. Right click on "app.config" and choose "Properties".
2. Configuration: Choose "All Configurations"
3. Single click on "Custom Build Step"
4. In "Command Line" type: copy "$(InputPath)" "$(OutDir)\$(TargetFileName)$(InputExt)"
5. In "Outputs" type: $(OutDir)\$(TargetFileName)$(InputExt)
|
|
|
|
|
|
|
The question makes non-sense. There is no such thing as decimal value or hexadecimal values. They are values only and this is their REPRESENTATION (so, how you print the values on the screen for example) that is either decimal or hexa.
Now, what you want to do exactly ? You have a string containing a decimal representation of a value and you want to convert it to an hexa string ? Or do you have a value and you want to print it in a string using its hexadecimal representation ?
Is it a managed question or a purely C++ question (then you are in the wrong forum). If its a C++ question, take a look at sprintf and the print format, you can do something like that:
int Value = 10;<br />
char HexaString[100];<br />
sprintf(HexaString,"%x",Value);
|
|
|
|
|
|
Did you read my post or what ?
There is no such thing as integer value or hex value ! They are all the same and stored in a binary format in your machine. It is only the way you represent them that changes ! If you have 24 apples on a table, the number of the apples will stay the same if you say 'I have 24 apples' or if you say 'I have 0x18 apples'. This is just the way you represent your value that is different. The value itself is neither in decimal or hexadecimal format, it is simply a value.
|
|
|
|
|
|
That's absolutely true!
It's the same thing with languages.
Wether you say "Hello, my name is Peter", "Bonjour, mon nom est Peter" or "Hallo, mijn naam is Peter",
it all has the same meaning, except for the fact that you use three different lingo's.
A decimal 15 = a hexadecimal F = a binairy 1111 = an octal 17.
You just use a different way of expressing the same thing.
Well, I guess that's quite clear now.
By the way: sorry for my wrong source yesterday!
Peter
|
|
|
|
|
I don't know what you want since you deleted your messages, but I hope this piece of code
helps.
One thing to know is that the standard representation of values is decimal.
Other possibilities: hex (hexal), bin (binairy), oct (octal).
<br />
#include < iostream ><br />
#include < iomanip ><br />
using namespace std;<br />
<br />
int main()<br />
{<br />
int a;<br />
int b;<br />
<br />
cout << "Please enter a decimal number which this program\nwill convert to a hexal number.\n";<br />
cin >> a; <br />
cout << "\nYour number is " << hex << a << " in hexal.\n\n";<br />
getchar();
<br />
cout << "Please enter a hexal number which this program\nwill convert to a decimal number.\n";<br />
cin >> hex >> b;<br />
cout << "\nYour number is " << dec << b << " in decimal.\n\n";<br />
getchar(); <br />
<br />
return 0;<br />
}<br />
Regards,
Peter
|
|
|
|
|
|
Hmmm...
It seems that way.
No-one's perfect!
|
|
|
|