|
I've recently been introduced to the networking side. The first task that I must do is to write a C++ program to capture IP traffic e.g. UDP, TCP, etc.
The second task is to feed this data into an database e.g. SQL or Oracle.
The third task is then to provide reports on this information.
I will be glad if somebody could assist me in this regard.
regards
Deon
|
|
|
|
|
Hello?
I need the Gaussian random number generator.
If you have source code, share to me pls
Thank you so much
|
|
|
|
|
Hi,
Check out "Numerical Recipes in C", Chapter 7.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
I have this program I have to write for school that accepts two integers. hours and minutes. I then have to output the format in 6:00 format. I'm only allowed integer division and and modulus division. I've tried everything I can think of but my output still looks like this. 6:0 Any tips?
BINARY
-- modified at 23:40 Saturday 22nd October, 2005
|
|
|
|
|
how do you print it ?
using printf("%2d", minutes); would help...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
That sucks - you have to either use some relatively advanced C++ stuff in iostreams, or use C ( i.e. use printf ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: That sucks
it was only a suggestion. i never said to use it and nothing else...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi for all
I started to study how I can access external devices in C++. I've entered in MSDN and I've found a thing called HID Collections. By the description of MSDN, HID Collections are a meaningful group of HID controls and HID usages. HID Controls are a data sources and data sinks associated with a HIDClass device. After this description I don't know if this way is correct to study device access.
Iwould like an orientation about this topic. Someone can put a little bit of light in this topic for me? I'm totally newbie in this.
Thanks a lot
|
|
|
|
|
Hi
My app stalls at startup because a file in the MRU list is on a network drive that doesn't exist.
The exact filename I am trying to add is "\\blah\start.txt".
I call CRecentFileList::Add from InitInstance. This Add function goes away for about 10secs before returning failure.
So I changed my code so that the Add function is only called if the file actually exists. But every function I tried (PathFileExists, _access, CFile::Open etc etc) always stalls for these 10secs.
There must be some function I can use that will check a file exists, which returns immediately...
Any ideas?
Thanks
d3m0n
|
|
|
|
|
what's your code please ?
these functions are not so long for me...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
<br />
for (POSITION pos = listFiles.GetHeadPosition(); pos; )<br />
{<br />
CString strFile = listFiles.GetNext(pos);<br />
if (_access(strFile, 0) != -1)
m_pmruFiles->Add(strFile);<br />
}<br />
This problem only occurs if I am connected to the network. If disconnected, it returns failure immediately.
|
|
|
|
|
this is not a problem a the function but the network access...
if you open a windows explorer and reach the networks around you, explorer will take several seconds to show you the first infos...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote: this is not a problem a the function but the network access...
Yes I have come to the same conclusion. I think it is impossible to solve this problem.
Thanks for your help
Cheers
d3m0n
|
|
|
|
|
I wonder why the upcasting only can happened to public inheritance? like:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Base
{
public:
};
class Pri : private Base
{
public:
protected:
private:
};
class Pro :protected Base
{
public:
protected:
private:
};
void func(Base* n){}
int main()
{
Pro pro;
Pri pri;
}
|
|
|
|
|
That's what private means.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I want to introduce Logs in my c++ program. which is faster fstream or 'c' language's FILE ? so that i can use in my logs.
Thanx in adv.
lokiz
|
|
|
|
|
FILE is not a method but only a structure. so, it doesn't perform any action, and we cannot calculate a duration on it...
i think you wanted to ask for fstream methods compared with C file handling functions (fopen() , fclose() , fread() , fwrite() , fprintf() , fscanf() , ...)
insn't it ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
yes TOX u r right. which is faster fstream methods or C file handling functions................
lokiz
|
|
|
|
|
C io library is faster. But if you want really fast IO, you should better use directly Windows API
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
You're asking the wrong question. FILE is C, fstream is C++. You should use C++ if your app is in C++, even if it takes a microsecond longer. Reasons - extensibility and ability to write good code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I would like to write some code to compare the files within a directory with a 2nd directory and see which files are either not in the 2nd dir or have been changed. The aim of which is to basically duplicate the contents of a directory to another but only changing what is essential, as I will be sending the files over the internet.
Sorry, I know that wasn't very clear, but hopefully someone will understand what I want to find out!
Thanks in advance,
-Caolan
|
|
|
|
|
I am not sure why I am getting error in displaying the output. I want output such that when I enter a string aaaabaaba... for "aaa" it shud give output 0 and "aba" it should give output 1. I am not sure where the error is??? Please help thanks is advance.
#include<iostream.h>
#include<stdio.h>
#include<string.h>
#include<windows.h>
char* in;
void main()
{
cout << "Enter your string here \n";
cin>>in;
while(*in != ' ') //it crashes here
{
if(strncmp(in, "aaa", 3)==0)
cout << "0";
if(strncmp(in, "aba", 3)==0)
cout << "1";
in+=3;
}
}
A
|
|
|
|
|
ashok123 wrote: char* in;
This sets aside the memory to store an address, but it does not actually create a block of memory to store your string to. You have a pointer, but it's not pointing to anything.
ashok123 wrote: while(*in != ' ') //it crashes here
This code is wrong on a number of levels. First of all, it requires that the string have a space in it. Secondly, because you step by three further down, it assumes that the string will be either a space, or characters in a multiple of three, and then a space. The easiest way to solve all of this is to use std::string instead of a char *, and then use std::string's functions to check the contents of the string.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Chris...
|
|
|
|
|
Hi friends
how copy my *.* files
target folder or other place please tell me copy code for C++
|
|
|
|