|
I'm having trouble finding a c or c++ function that will convert a string of 1's and 0's to a string of characters. I also need something that will do the opposite. I was just wondering if there is a class out there that will handle this. I really don't feel like writing my own, if I can find one that will do it for me.
|
|
|
|
|
mindspin311 wrote: I'm having trouble finding a c or c++ function that will convert a string of 1's and 0's to a string of characters.
Assuming you meant to its numeric equivalent, check out strtol() .
mindspin311 wrote: I really don't feel like writing my own, if I can find one that will do it for me.
There are plenty available (e.g., CP, Google), but writing your own will take all of five minutes. You'll spend more time than that searching (and then implementing).
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: but writing your own will take all of five minutes
Sure?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Ok, four minutes if you don't do any simultaneous browsing or game-playing.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
OK, I promise to do no browsing nor game-playing (until the four minutes timeout expiration) while waiting him to complete the job.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi i'm wondering if the console could be viewed in windows forms?
I'm not sure what the line would be to view the console.
Sorry to post this on this forum but the is best forum in terms c++ help.
|
|
|
|
|
Are you wanting to spawn, and view the output of, a console application from your code?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have code that writes to a console but I can't see the console because it is a windows forms application i'm writing
|
|
|
|
|
I'm confused. If you are already writing to the console window, can't you just write the same text to some other location (e.g., a form)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The code that writes to the console is to connect to a server and I don't want that to be shown on the form for the user to see but in the background in a console. It connects to the server fine but just doesn't display in a console window.
|
|
|
|
|
gman2008 wrote: The code that writes to the console...
How are you doing this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've wrote an interface using windows forms and when the user clicks a button on the menu then this executes code from another class that connects to a server. The code that connects to the server was originally a console application and I have incorporated that code into the interface.
I appreciate your help but I don't want to waste your time as I think this is not that important.
|
|
|
|
|
So what is it that you are expecting to be written to the console window?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This is what I expect to see in the console window:
PANGU Protocol Library Tester by Martin N Dunstan
Getting image 'zoom_000.ppm'
Getting image 'zoom_001.ppm'
Getting image 'zoom_002.ppm'
Getting image 'zoom_003.ppm'
Getting image 'zoom_004.ppm'
Getting image 'pitch_000.ppm'
Getting image 'pitch_001.ppm'
Getting image 'pitch_002.ppm'
Getting image 'pitch_003.ppm'
Getting image 'pitch_004.ppm'
Getting image 'roll_000.ppm'
Getting image 'roll_001.ppm'
Getting image 'roll_002.ppm'
Getting image 'roll_003.ppm'
Getting image 'roll_004.ppm'
Getting image 'yaw_000.ppm'
Getting image 'yaw_001.ppm'
Getting image 'yaw_002.ppm'
Getting image 'yaw_003.ppm'
Getting image 'yaw_004.ppm'
Getting image 'fov_005.ppm'
Getting image 'fov_010.ppm'
Getting image 'fov_020.ppm'
Getting image 'fov_040.ppm'
Getting image 'fov_080.ppm'
Getting image 'sky_0.ppm'
Getting image 'sky_1.ppm'
Getting image 'sky_2.ppm'
Getting image 'sky_3.ppm'
Getting image 'sky_4.ppm'
Getting image 'sky_5.ppm'
Getting image 'orange_sun.ppm'
Getting image 'green_planet.ppm'
Camera position = (192.257004, 192.257004, 126.785004)
Camera attitude = (yaw 135.000000, pitch -10.000000, roll 0.000000
Elevation above the surface = 113.580620m
Position on surface below camera = (192.257004, 192.257004, 13.204384
Elevation above the surface = 113.580620m
Pixel (0.500000, 0.100000) has position (-5.694656, -5.694656, 13.117
Elevation at <192.3, 192.3, 126.8> = 113.580620
Elevation at < 10.0, 10.0, 300.0> = 287.761566
Elevation at < 10.0, -10.0, 300.0> = 286.706177
Elevation at <-10.0, -10.0, 300.0> = 286.901917
Elevation at <-10.0, 10.0, 300.0> = 288.203522
Elevation at < 0.0, 0.0, 300.0> = 287.099243
Getting image 'trash.ppm'
Performing multiple LookupPoint() requests:
Model under pixel <0.500000, 0.100000> = < 84.9, 84.9, 12.0>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <1.000000, 1.000000> = <-417.3, -163.6, 6.4>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model under pixel <0.500000, 0.900000> = <-144.4, -144.4, 17.7>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Performing one LookupPoints() request:
Model under pixel <0.500000, 0.100000> = < 84.9, 84.9, 12.0>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <1.000000, 1.000000> = <-417.3, -163.6, 6.4>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model under pixel <0.500000, 0.900000> = <-144.4, -144.4, 17.7>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model at < 0.0, 0.0, 12.9> along <0.000000, 0.000000, -1.000000>
Model at <-59.3, 118.5, 7.3> along <-0.100000, 0.200000, -1.000000>
Model at <293.1, 117.2, 13.8> along <0.500000, 0.200000, -1.000000>
No model along <0.500000, 0.200000, 1.000000>
|
|
|
|
|
I don't want this information to be displayed to the user on the form but as a background job in a windows console.
I'm just not sure why the console is not showing up.
Even if I just write a simply command in the form as:
<br />
Console::WriteLine(L"Hello");<br />
A console is not shown with the word Hello.
Sorry I’m going to be offline now and won’t be on until tomorrow. I would to thank you for looking into helping me with this problem.
|
|
|
|
|
gman2008 wrote: Console::WriteLine(L"Hello");
Is this VC++? Managed?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a Visual C++ book that has windows forms in it but I think it goes under managed
|
|
|
|
|
So you might want to re-ask your question here. There are several ways to spawn a console window and write to it, so I can only surmise that managed vs. unmanaged code handles it differently under the covers.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Visual Studio VC++ 6 development system worked fine so far on Windows XP computer, but now on my Windows Vista class wizzard looses classes and on laucnh and each compilation session there a message appears of incompatibility with Windows Vista. How can I solve this problem ?
|
|
|
|
|
André Dewispelaere wrote: ...each compilation session there a message appears of incompatibility with Windows Vista.
Have you searched for the exact error message?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
André Dewispelaere wrote: How can I solve this problem ?
turning off UAC solves the compilation warnings.
class wizard has always been a little forgetful, regardless of OS, so i didn't notice any change in Vista.
|
|
|
|
|
Dear all:
I am trying to use the hash_map in C++ in VS2005.NET.
The code is like:
<br />
#include <hash_map><br />
...<br />
...<br />
hash<const char*=""> H;<br />
size_t h = H("ca");<br />
</const></hash_map>
I want to generate the hash value for the string. This code works perfectly in Linux but in VS2005 it complains that:
1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(54) : error C2065: 'hash' : undeclared identifier
1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(55) : error C3861: 'H': identifier not found
It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Thanks
Asura
|
|
|
|
|
Ming Luo wrote: It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Does the hash_map file exist? Can the compiler find it? If you right-click the #include statement, can you opt to open the file?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Does the hash_map file exist?
Indeed it exists (at least on my system, VS2005). On the other there's no hope to find the hash class itself (again, on my system).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello everyone,
I listed for scenarios. I think case 1, 2 and 4 are object's destructor is called during stack unwinding caused by exception. Scenario 3 is not stack unwinding and it is normal function return (not exception) triggers the destructor of the object.
Scenario 1:
try{
local object defined;
exception throws;
} catch ()
{
catched;
}
Scenario 2:
try{
local object defined;
exception throws;
} catch ()
{
not catched;
}
Scenario 3:
local object defined;
try{
exception throws;
} catch ()
{
catched;
}
Scenario 4:
local object defined;
try{
exception throws;
} catch ()
{
not catched;
}
thanks in advance,
George
|
|
|
|
|