|
I am so sorry. I mistype:
it should look like this:
A 010 N 140
B 020 O 150
C 030 P 160
D 040 Q 170
E 050 R 180
F 060 S 190
G 070 T 200
H 080 U 210
I 090 V 220
J 100 W 230
K110 X 240
L 120 Y 250
M130 Z 260
My output should be:
A 10 N 14
B 20 O 15
C 30 P 16
D 40 Q 17
E 50 R 18
F 60 S 19
G70 T 20
H80 U 21
I 90 V 22
J10 W 23
K11 X 24
L 12 Y 25
M13 Z 26
|
|
|
|
|
You just can't make up your mind, can you? First you state that "it should look like this" and show one table, and then you follow that with "my output should be" and show a completely different table.
In the bottom table, do you not see the obvious error? A and J cannot both be 10.
|
|
|
|
|
Now I understand what you are saying. I am appreciated for your patient.
I am just learning C++, so I am not seeing full picture at first.
My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers.
I got it to work but I am missing zero after the number if number=10…90.
What would you recommended to do with the J?
|
|
|
|
|
sardinka wrote:
My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers.
This will do exactly that:
sprintf(Tempcrap1, "%d", (Modi[i] - 64) * 10);
|
|
|
|
|
I copyed your line of code into my program.
here my output(what I am getting).
Examples:
Entered Value:Should be : I am getting
9AB : 90102 : 91020
Z73 : 26073 : 26073
9ZY : 92625 : 9260250
|
|
|
|
|
There are still discrepancies. For example, when Z73 is input, you want (and are getting) 26073 as output. Assuming the 26 is for the Z, why does the 7 get a leading 0 but the 3 does not?
Use:
sprintf(Tempcrap1, "%02d", Modi[i] - 64);
when converting letters to numbers, and:
sprintf(Tempcrap1, "%d", Modi[i] - 48);
otherwise. This will produce:
Input : Output
9AB : 90102
Z73 : 260703
9ZY : 92625
|
|
|
|
|
I do not need to produce for 7 a leading 0.
In this case should be Z-260 and rest of the string.
|
|
|
|
|
Do you not find it odd that each time you state what you want, it's different from the time before? Has anyone ever told you it's very difficult to hit a moving target?
In this latest post, you want "260" to be the output for "Z", yet in the previous post (i.e., "9ZY : 92625 : 9260250"), you want "26" to be the output for "Z".
I think it's time you step back and better define your requirements.
|
|
|
|
|
Hi
I hope I am not asking a real dumb question but this problem has got me beat. I am compiling my MFC developed application and linking it with someother libraries that I have got from somewhere and compiled myself. When I do this I get the following linking errors
ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol __pctype
ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol __pctype
ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
Release/LMWS.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Before getting to this stage I had some errors about duplicate definition of stuff in libcmt.lib and msvcrt.lib so I have told the system to ignore libcmt.lib
Now I have looked on the web and seen that the offending symbols are declared in ctype.h.
Now my questions are
- obviously now can I sort this out
- but also in the error message I am getting the symbols have two '_' and three '_' characters respectively but in the ctype.h file they only have one and two respectively.
Is this second question of any relevence or am I just not understanding how the compiler puts it altogether.
Many thanks for any help.
Andrew
|
|
|
|
|
With respect to your second question, I guess the extra underscores are not important --it is some sort of name encoding performed by the compiler prior to letting the linker act. If you want to see this in full action, try declaring and using some undefined member function on a class of your own: when the linker fails to find the definition you'll see the name has been adorned with all kinds of funny characters.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
If all this is in V6... I don't know settings in V7, then:
Probably you have checked in project settings "Ignore default libraries". Try to add in libraries section libcd.lib (for debug builds) or libc.lib (release).
The best way to detect such missing link symbols - at least for me - is to copy the offending symbol name, modify project settings to:
- uncheck "Ignore default libraries"
- check in Link --> Customize --> Print Progress messages
and rebuild all.
The linked with produce a verbose output wher you can search for the symbol. Usually, it will look like this:
[Unsuccesful build]
xxxxxxxx.obj : error LNK2001: unresolved external symbol _yyyyyyy
[Rebuild with ignore default lib. off]
Searching <your-lib-path>\<libname>.lib:
Found __yyyyyyy
Referenced in xxxxxxxx.obj
Loaded DDDDDDDD.lib(DDDDDDDD.dll)
Now you see that the missing lib is DDDDDDDD.lib; put back your project settings, add the new lib to Link section and rebuild.
Usual trap libraries:
- CRT: libc.lib (C), libcp.lib (C++), libcmt.lib (C multithread), libcpmt.lib (C++ MT)
- msvcrt.lib
(add a 'd' for debug builds, so Release uses libc.lib, Debug uses libcd.lib etc.)
- COM support classes (_com_error) in comsupp.lib
- Common dialogs in commdlg32.lib
- shell API (shlwapi.lib)
just to point some of (my ) usual mistakes.
|
|
|
|
|
Hello
RequireMent:: i need to show the network of some nodes connected(for expample in LAN or some mesh network) graphically.
like this may be.........
MD(router)
ND0 ND1 ND2 ND3
ND00 ND01 ND03 ND30 ND31
MD:Main Device
ND:Network Device
something like above but with links b/n them and nodes(may be with some bitmaps) at Specific place.
anyone has any idea of drawing this network.
can u guys plz help me out
Thanks
Adi
|
|
|
|
|
is there a mean to justify a paragraph with the Graphics::DrawString() function of gdi+ ?
Thx for your help
|
|
|
|
|
is there any way wherein we can set the paragraph text as both left justified and right justified??
As far as i understand we have only the left, right and center justifications.
is there any means that we can tell the GDI plus to take care of automatically justifying the text.
a quick help would be appreciated
aparna
|
|
|
|
|
Hello people,
I wanted to know on what factors does the size of an integer and a pointer depend, because they are different on different machines i think.
OMAR ALVI
|
|
|
|
|
|
if it only depends on CPU architecture then why does it show me 2 bytes when i use Borland or TC and shows integer size to be 4 bytes when i use VC++, althought its the same pc.
|
|
|
|
|
You are comparing compiler specific variable types. Even though an "int" may be 4 bytes in Visual C++ and 2 bytes in Borland, both compilers depend on the CPU architecture.
Kuphryn
|
|
|
|
|
okay i get it, and what about the size of the pointer,does it depend upon the size of the address bus of the cpu ??
Omar Alvi
|
|
|
|
|
Omar Alvi wrote:
does it depend upon the size of the address bus of the cpu
Yes, but there are some issues. Under DOS or Windows before Win95, a pointer was 16 bits. Under Win95 or later, a pointer is 32 bits (although under 64-bit Windows it's 64 bits). Even though it may be the same computer. The PentiumIII and later processors actually have an address bus larger than 32 bits (From memory I think it's 36 bits), but the OS does not use it all at the moment, so a pointer is still only 32 bits.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I have been working on this for about 3 weeks and have not got any where. Perhaps someone out there can send me in the right direction. The Big picture I'm after is, given a length and width (of a 2d shape)Draw the shape to the screen centered and given a little margin, and be able to drag the mouse across the screen and it will display the XY in the status menu (have the code for this done but numbers are wrong....just need the formulas to calculate it), and finally to be able to Zoom or Pan.
Thats the total direction I'm heading, but I believe the panning and zooming in MFC is real easy by just setting the SetViewExtents and by moving the view origin around (again that is what I believe)
What I've been banging my head against the wall with is this centering aspects of the shape. (AS A SIDE NOTE: I want the units to be real ie if I have a rectangle that is 5.25x1.25 in or mm then use those such that when I do my magic calculations then the cursor gives you those positions as you move the cursor over it)
Anyway, back to the orignal, This is the code I have been playing with in my Ondraw functin:
(CPoint apt is the length and width of the rectangle) if I change these I want the shape to be drawn centered
CTestHelpDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
m_pDC=NULL;
CPoint apt;
apt.x=5250; //5.25*1000
apt.y=1250;//1.25*1000 units scaled by 1000
CRect arect;
GetClientRect(&arect);
pDC->SetMapMode(MM_ISOTROPIC);//MM_HIENGLISH
int m_iView=(int)(viewextents);
pDC->SetWindowExt(m_iView,m_iView);
int m_iSize=0;
if(arect.right>arect.bottom)
m_iSize=int(arect.right*scalefac);
else
m_iSize=int(arect.bottom*scalefac);
double testX=apt.x/viewextents;
double testY=apt.y/viewextents;
double m_RatioX= testX * m_iSize;
double m_RatioY= testY * m_iSize;
int Rx,Ry;
// Rx=(m_iSize-m_RatioX)/2;
// Ry=arect.bottom-(arect.bottom-m_RatioY)/2;
Rx=(((double)apt.x*((double)arect.right/viewextents))+arect.right)/4;
Ry=m_RatioY/2;
pDC->SetViewportExt(m_iSize,-m_iSize);
// pDC->SetViewportExt(viewextents/2,-viewextents/2);
// pDC->SetViewportExt(testX,-testY);
// pDC->SetViewportExt(arect.right,-arect.bottom);
// pDC->SetViewportOrg(m_iSize/2,m_iSize/2);
pDC->SetViewportOrg(arect.right/2,arect.bottom/2);
// pDC->SetViewportOrg(Rx,Ry);
// pDC->SetViewportOrg(m_RatioX,m_RatioY);
// pDC->SetViewportOrg(m_RatioX,m_RatioY);
// pDC->SetViewportOrg(testX/8,testY/1.4);
// pDC->OffsetViewportOrg(-apt.x,-apt.y);
pDC->OffsetViewportOrg(-Rx,Ry);
// pDC->OffsetViewportOrg(-m_RatioX*1.3,m_RatioY*2.0);
pDC->Rectangle(0,0,apt.x,apt.y);
//Orgin
pDC->MoveTo(0,0);
pDC->LineTo(0,50);
pDC->MoveTo(0,0);
pDC->LineTo(50,0);
I need to set this up correct so when I go after the mousemove to update the status pains with the locatin in real units that they work correctly as well as have it ready for zooming and panning.
Thanks in advance!
-Eric
|
|
|
|
|
I want to develop a FTP client like Cuteftp,and want to share my addressbook with the cuteftp, so I need to know the structure of the addressbook of the cuteftp. Who knows it or where can I find the explanation of the structure of the addressbook?
Thank you very much!
|
|
|
|
|
I do have MSDN.But I don't know which keyword I can use to look for it!
|
|
|
|
|
SystemParametersInfo() with the SPI_SETDESK_WALLPAPER option. However, this is a temporary change (it disappears after a reboot). To make it permanent, you'll also have to change the registry. The key to look at is "HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper".
Remember that this only works if web-view is disabled for the desktop, and Windows can only show BMP images when web-view is disabled.
Hope this helps
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|