I think I am missing out something but dont know exactly where I am wrong ...
I am getting followinf Error in MS Visual Studio8 (Error C2106 : '=': left operand must be |-value..... (I am not getting wht this error iss for..........? )
You can't just assign arrays like that. You need to copy the contents of the source array to the destination array.
memcpy(ArrayData, ps->Data, MAX_TP_DATA_BYTES);
If you are using VS2005 or later you really should use the safer memcpy_s method instead because the memcpy method has been deprecated. The difference is that the memcpy_s method takes an extra parameter stating the size of the destination buffer and the method also now returns an error_t.
I am looking for your opinion - not asking for code or someone to do my work.
I have ASCII text files that consist of several thousand four digit numbers in each file. My job is to write a program that counts how many times each four digit number appears in each file.
Every four digit number will be on it's own line, like this:
I know how to iterate the list. I have had several ideas on counting the individual numbers (in other words, how many times does 7737 etc appear in the file) but none that I think are very efficient - and whereas some of the best programmers in the world frequent this excellent place, I wondered if someone could give me an idea on a concept.
ok you challence me, but your question is too generic: what is the distribution of the numbers? And tell me more about the numbers you want to count: what is their distribution over the numbers in the file?
If the distribution of numbers is random there's no knowledge you can take account in your algorithm. Then the solution is: read the file as quick as possible and build an internal array that holds the counts.
If you're looking for performance i would rewrite the file, because for each number you have to figure out what number it is. It would rewrite it to a binary file, each number in a 2-byte int, no line feeds. Saves space a make the program more quickly
You have a maximum of 10,000 numbers. An int array of 10,000 items is about 40k. Since every line is 6 bytes, you can read the entire file into memory, or you could create a read buffer of, say, 6k. Then write a simple algorithm to convert the numbers to binary. Use this number to increment the value at the index in the array.
I am a java guy. I am sorry if my below post sounds basic stuffs. Basically I am working for a project that has C++ back-end and Java in the front-end.
Currently developing a module that sends out an e-mail message (just plain text) to all recipients and/or group of recipients from Java GUI that uses C++ back end running on HP-UNIX to send mail using "sendmail" command via SMTP. After having spent quite a bit of time trying to figure out a way to get the delivery status back off of SMTP server (to display the status for each recipients in GUI), I have been unable to find a way to get this job done. I just piping the message (C++ code) to server that contains "sendmail" command along with address and message body.
I was hoping to find out - Is there a library api available for C++ to send mail via SMTP to make life easier? Or is there a simple C++ code that does this, basically I would have to get the delivery status for each recipients.
I am looking for something similar to CSMTPConnection v1.36[^] that I can use for HP-UNIX (I guess this was developed for Windows MFC) OR can I still use the same for C++ running on HP-UNIX as well ?
I would truly appreciate any input/suggestion on this.
As I said earlier - I am doing some enhancements to existing application that is built on C++ back end. So C++ not only sends mail out but also does other stuffs. I know that I can use Java to do this but I got to use C++ (Real Time server that runs on HPUX).
All am looking for is a way to read the response back from server that tells whether or not message is delivered.
just pumping it up guys - tried to google it - do find couple of library that does this for you but problem is that either got to pay for it or library with whole bunch of other stuffs that you got deal with. Could not help.
really looking for something simple ..c++ library api OR c++ code which is simple enough to send mail using sendmail command & tells the delivery status for each recipients.
I created an MFC application and added Printing and Print Preview capability to a CMyFormView derived from CFormView. The problem is that the "Prev Page" and "Zoom Out" buttons on the Print Preview toolbar are always disabled whether the second, third or last page is displayed. The "Next Page" button are always enabled and work correctly.
For the Prev Page button, I set CPrintInfo::SetMaxPage() and CPrintInfo::SetMinPage(). However, this doesnt work to enable the Prev Page button. In debug mode, I could see that CPrintInfo::m_nCurPage value was correct within OnPrint() method when the program is in print preview. Anybody knows how to enable Prev Page button in Print Preview dialog?
i'm working now to complete DSA algoritm but i can't...
help me to complete thes algorithm
i'm work in c++ and i came copy to header files like sha1.h /
cdefs.h /null.h /wchar.h
featuretest.h / cdefs_aout.h /cdefs_elf.h/ common.h/ ast_common.h/
i put all this in INCLUDE file and SYS
but featuretest.h can't open
please tell me what i can do ???????
I am using vector to store the incoming data. Now my data is stored in Struct. I want to store only "bydata" from my structure into vector.... as the data keeps coming in.... I will just keep adding at the end of the vector "bydata" .....
How do I store this data using vector... or theres any other method tht I can use it.....