Search:
Type: Posts; User: aryan1
Search :
Search took 0.03 seconds.
November 6th, 2012 10:40 AM
Here is the prototype of the function:
void fillTopoArray(string topoFileName, int topoGraph[][MAX_VERTICES], int *nodeCount, int *edgeCount);
Here is how the parameter passed to the...
November 6th, 2012 05:01 AM
Hi All,
I have a function such that one of its parameters is a 2D array of type int. The parameter is defined as follows:
[code]
int topoGraph [][MAX_VERTICES]
[\code]
However, the...
April 11th, 2012 03:51 AM
Thank you very much.
Yes - that is the point that I was missing.
April 11th, 2012 02:55 AM
Below are two functions:
void printGraph(const int* topology, int dimSize)
{
for(int rowIndex = 0; rowIndex < dimSize; rowIndex++)
{
for(int columnIndex = 0; columnIndex <...
April 10th, 2012 08:14 AM
Hi,
After passing the address of the first element (&array[0][0]) of a multi-dimensional integer array to a function with a "const int*" parameter, parameter seems to be pointing to the wrong...
Hi All,
Following function obtains the system-maintained structure for a message queue:
bool getMessageQueueStats(int mqId, struct msqid_ds* buf)
{
if(msgctl(mqId, IPC_STAT, buf) ==...
No, there is no reason - It's just bad programming.
When does an invalidation of a pointer take place ?
I think that it depends on the layout of the memory at a certain time.
Hence, even for...
Hi All,
Given the following piece of code in D.cpp :
//set string myString
//set boolean myBoolean2 and myBoolean1
bool marked = false;
Hi All,
Given the following line numbered 780 in my_daemon.cc:
exit(EXIT_FAILURE);
valgrind generates the following invalid read error:
This problem seems to be weird.
At one execution of my program, time increment works fine, but on another run of my program at a later time, it does not. (I run it with the same user)
After...
My question was something else.
Can you imagine any factor which may cause gmtime() or localtime() functions to behave differently for the same input at different times ?
That is, I sometimes...
To give an example to false looking result of gmtime(), given the following year/month/day/hour/minute input:
2010/04/02/10/00
The result returned by gmtime() is:
2010/04/02/07/05, where...
Hi All,
Following C++ function is expected to add 5 minutes to a certain date and time in "Broken-down time" format, and output the new date and time in the same format again:
void...
April 28th, 2010 04:06 AM
Hi All,
I think that it is not legitimate to erase entries in a map in the following way:
MyMap temp;
//fill in temp here
April 16th, 2010 07:30 AM
Hi All,
Using C++, I want to process sub-folders on my home folder sequentially each with a special naming format and containing some binary files in it:
1/
2/
3/
4/
April 15th, 2010 06:18 AM
Thanks.
This is much better.
April 15th, 2010 03:27 AM
What do you think about the function below ?
int checkConNullBytes()
{
const char *BEGIN = dataStream.str().c_str();
const char *END = dataStream.str().c_str() +...
April 15th, 2010 03:00 AM
Sorry, I admit that my question was not clear.
If I have the following binary stream in hex representation:
00 01 02 03 00 00 04 05 00 00 00 06 07
what I want is to obtain the size of...
April 15th, 2010 02:01 AM
Hi All,
Is there any function in C++ 's standard library or in STL which gives the number of consecutive characters in a stringstream object ?
std::count() and strspn() do not seem to be what I...
Hi All,
Following function utilizing boost's string tokenizer class crashes as might be expected:
bool CheckCommand(const string& cmd, const string& line)
{
if (line.length() == 0)...
Let me clarify the reason why I posted this thread.
Assuming we have following "u_char" binary data (call it myData) with hex representation of size 23 bytes :
55 11 93 2b 55 6a 56 5c 60 2d...
All the sizes for data types that I listed in my posting have been verified to be correctby using sizeof() statements.
Hi All,
I want to define a C-struct as shown below, which will be written to a message queue:
struct msg
{
struct in_addr addr1, addr2; // 4-byte
u_int32_t s; ...
March 31st, 2010 04:34 AM
So the following code snippet will do the job:
const char *BEGIN = buffer;
const char *END = buffer + 1000000;
size_t numberOfNullChars = count(BEGIN, END, 0);
March 31st, 2010 04:12 AM
What if I want to count for the number of NULL characters in a char array ?
Given the following value for buffer with no terminating null character:
buffer[0] = 'a'
buffer[1] = 0...
Click Here to Expand Forum to Full Width