|
Thank you so much!
As it turns out, she has no need to use pointers anyway, so we've gotten rid of all the pointers that she's been using.
|
|
|
|
|
This is C++:
int *suit[4];
for(int p = 0; p <= 3; p++)
{
suit[p] = &p;
}
This is C:
int *suit[4];
int p;
for(p = 0; p <= 3; p++)
{
suit[p] = &p;
}
This is what I think your are trying to do since what you are doing makes no since:
int suit[4];
int p;
for(p = 0; p <= 3; p++)
{
suit[p] = p;
}
One last note: Get out of the habit for writing p++ when not neccessary, use ++p instead. When your friend graduates from C to C++ it will eventualy save her a lot of head acks, because post increment can lead to a great deal of unexpected over head when using user define data types.
INTP
|
|
|
|
|
I am just beginning to use Visual C++ and want to make simple math programs. I need to know how to find the Sin and Cosine and basically the other functions a scientific calculator would have. So if someone could point me in the right direction, I'd appreciate it.
Thanks,
Trurl
|
|
|
|
|
|
"Floating-Point Support" in MSDN
KEYWORDS: sin, cos, tan, sqrt.
But even making a simple math program is a bit more complicated, unless you are just planing to douplicate the functionality of the calculator that comes with all Windows OSs.
INTP
|
|
|
|
|
Thanks for the help. Is there any other software program that lets you do simple problems. I was just going to use C++ to change the values of the variables. If I need further help with the code I will post here.
Thanks again,
Trurl
|
|
|
|
|
It's on may to do list.;)
There are some simple ones out there, but they are ususaly hard to find. I am pretty sure there is class at codeproject that supposed to help, but I cann't seem to find it right now. I wrote recursive descent parser years ago origanly based on the one presented in the book "Advanced C Programming" publish by "Prentice Hall Computer Publishing". The book is probably out of print now. Try searching the net for "recursive descent parser" or "equation parser". Also go to microsoft.com and look for the "PowerToys", there should be graphing calculator there (I personaly did not care for it much).
Ahh! PowerToys!
Now I am off to see if they have new ones, specificaly for XP.
Have Fun!
INTP
|
|
|
|
|
hello all,
i am stuck with a usual problem of creating a listening port in VC++.
i tried CSocket class and then Create()function as:
Create(5001,SOCK_STREAM,"127.0.0.1")
but this is not working
pls help!!!!
thanks
Deepesh Dhakad
Indian Institute of Information Technology,Allahabad
India
|
|
|
|
|
You should call GetLastError() to see whats wrong
|
|
|
|
|
m_hSocket = socket(AF_DLI, SOCK_STREAM, 0);
return (m_hSocket != INVALID_SOCKET);
#define AF_UNSPEC 0 /* unspecified */
#define AF_UNIX 1 /* local to host (pipes, portals) */
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
#define AF_IMPLINK 3 /* arpanet imp addresses */
#define AF_PUP 4 /* pup protocols: e.g. BSP */
#define AF_CHAOS 5 /* mit CHAOS protocols */
#define AF_IPX 6 /* IPX and SPX */
#define AF_NS 6 /* XEROX NS protocols */
#define AF_ISO 7 /* ISO protocols */
#define AF_OSI AF_ISO /* OSI is ISO */
#define AF_ECMA 8 /* european computer manufacturers */
#define AF_DATAKIT 9 /* datakit protocols */
#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
#define AF_SNA 11 /* IBM SNA */
#define AF_DECnet 12 /* DECnet */
#define AF_DLI 13 /* Direct data link interface */
#define AF_LAT 14 /* LAT */
#define AF_HYLINK 15 /* NSC Hyperchannel */
#define AF_APPLETALK 16 /* AppleTalk */
#define AF_NETBIOS 17 /* NetBios-style addresses */
#define AF_VOICEVIEW 18 /* VoiceView */
#define AF_FIREFOX 19 /* FireFox */
#define AF_UNKNOWN1 20 /* Somebody is using this! */
#define AF_BAN 21 /* Banyan */
Best Wishes,
ez_way
|
|
|
|
|
i have written this piece of code in VC++ and i always get message saying "Can't Creat".
CSocket s;
if(s.Create(2500,SOCK_STREAM,"127.0.0.1"))
{
s.Listen(2);
MessageBox("Created");
}
else
{
MessageBox("Can't create");
}
please HElp
Deepesh Dhakad
Indian Institute of Information Technology,Allahabad
India
|
|
|
|
|
Works fine and compiles perfectly. Look at socks version and includes.
I used VC6 E.E. on XP Home.
Also make sure your ip address is 127....
Best Wishes,
ez_way
|
|
|
|
|
AARRGGHH!
did you ever work with resources in the 2003-IDE? It's getting me mad! And it gets worse: today it decided that i can't move or size the dialog-elements by keyboard. makes me think to go back to VC6.....
Is there an MS-guy listening? Or anybody know whom I can tell how frustated I am?
1. Date-Time picker always is set back to 'DTS_SHORTDATE' when you open a dialog
2. When you Double-click on an Element it adds an OnKlick-function. But all i wanted was the Properties (there was an option in VC6)
3. It never remembers anything like the size of the columns in string resource editor, guide settings (please, grid with 5 DLU, can't be that difficult)
4. when you copy and paste menuitems, the IDs are converted to numbers
5. when you insert an icon you have to select the properties from the resource view window to alter the ID
6. when you use the wizard to connect a variable to a dialog element, the source windows pop up so i can't simply design my dialog, connect all the elements an start coding
7. there should be a button in all the code wizards saying 'never ever p*** me on with stupid comments' (that's like those Einstein-comics in Office)
8. in large solution with serveral projects the code wizards get confused if you got files with identical names (like the completely uncommon 'mainfrm.xxx') and inserts the code in one of those randomly choosen
9. - 213345. not enough space.....
how do you guys work with this thing?
think i have a beer....
dirk
|
|
|
|
|
DiWa wrote:
6. when you use the wizard to connect a variable to a dialog element, the source windows pop up so i can't simply design my dialog, connect all the elements an start coding
This drives me nuts as well. It could be solved with a simple button at the bottom of the "wizard" (who in the world calls a one page dialog a wizard anyway? So while at it, get rid of the ugly banner.)
Also add:
10. When adding a variable/method, remember the settings I used previously, at least for that session. (Why keep defaulting to public? If anything, it should default to 'protected' when doing this for resources.)
(BTW, I had to recently work in VS 6 after a nine month absence and hated it.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote:
(BTW, I had to recently work in VS 6 after a nine month absence and hated it.)
Well, I would dislike to go back to VC6, MFC 7.1 is a large improvement, a lot of things work better and cleaner.
But I'm thinking that with some work one could integrate everything in the good old environment. (sounds like christmas is saved)
dirk
|
|
|
|
|
Hehehe, it also happened to me, i went out and spend big bucks on .NET, only to get so frustrated and disapointed by it that i put it back on its box, stored it in the "Never to be used again" section of my closet, and went back to VC6.
Without trying to start a huge devate here, it is my opinion that VC.NET´s IDE is a total piece of junk!. I mean, i dont know whats with microsoft recently, they have allways been greedy, and have overly expensive products, but at least the USED TO be of relatively good quality, now most their products are junk!
If i were you, id go back to VC6. but like i said before, Its only my opinion.
|
|
|
|
|
Well, I can see that is a lot easier to integrate everything in one environment, that looks and acts the same in VC++ and VB. But I ever disliked that VB property pages, where you have access to all and everything, but that hides the things you need and frequently use in a pile of clutter. Sometimes I feel like looking for a needle in a haystack. And then, i can deal better with a style ES_READONLY than setting something called 'read only' to false.
VC6 was not that 'one size fits all' aproach we see here
dirk
|
|
|
|
|
Hang in there!
I have not gotten the lastest and greatest from MS yet and I am not sure I want it. One thing I do know is that when I first got my hands on VC6 it drove be up the wall. Just like the operating systems that come out of MS, the development tools change in mysterious ways. Once you know how it works though you will probably never want to go back.
INTP
|
|
|
|
|
I have found many examples on how to build up a Word document. I would like to parse an Word document and extract the document content and structure. (Not the on tables, then on sections, then on paragraph). The ultimate would be the MSDN "Word2XML" project in MFC!
|
|
|
|
|
Hi, I am having an issue trying to post data using the serverxmlhttp interface. Here is a brief overview:
I am collecting data and automatically sending this data back to central repository. Currently, ftp and smtp protocols perform as expected. HTTP is another story. I have a microsoft service running that kicks of the 'transmitter' when there is enough data to send. That service is running with an administrator account (not THE administrator, but a created user with administrative privaledges.) Anyway, when this service kicks off and creates the COM component that actually does the transmissions, my http transmission portion returns a "Access denied" error. If I run the COM component from an executable, however, the transmission succeeds.
I thought that this was an inheritable rights type problem dealing with the service, however, I have redesigned the system and am now having a server component create and launch the COM transmitter. I still am having the same issue.
Any help would be greatly appreciated. Thanks
dman
|
|
|
|
|
Hi I have an array declared in function:
char test[3][10];
How do I return this whole 2 dimensional array from a function??
Thanks.
|
|
|
|
|
|
Just like you would any other pointer. Make sure that the array is either global, or a static variable. Otherwise, when the function goes out of scope, the variable is no longer valid. If the array is global, there really is no need for a function to return it, as all other functions would have access to it anyway.
Read here for more.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
public:
CImageList images;
...
images.Create (IDB_SYMBOLS, 16, 0, RGB (192, 192, 192));
...
...
for(i=0;i
|
|
|
|
|
Do you mean that you run this code for extended period of time?
If you do this 1000's of times, you will get 1000's of resource leaks.
You need to release the HICON resources aftre you have finished with them.
DestroyIcon(hIcon);
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|