Type: Posts; User: aryan1
Search took 0.01 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
I have a function such that one of its parameters is a 2D array of type int. The parameter is defined as follows:
int topoGraph [MAX_VERTICES]
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
After passing the address of the first element (&array) of a multi-dimensional integer array to a function with a "const int*" parameter, parameter seems to be pointing to the wrong...
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...
Given the following piece of code in D.cpp :
//set string myString
//set boolean myBoolean2 and myBoolean1
bool marked = false;
Given the following line numbered 780 in my_daemon.cc:
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)
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:
The result returned by gmtime() is:
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:
April 28th, 2010, 04:06 AM
I think that it is not legitimate to erase entries in a map in the following way:
//fill in temp here
April 16th, 2010, 07:30 AM
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:
April 15th, 2010, 06:18 AM
This is much better.
April 15th, 2010, 03:27 AM
What do you think about the function below ?
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
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...
April 9th, 2010, 03:28 AM
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)...
April 7th, 2010, 07:51 AM
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...
April 7th, 2010, 07:37 AM
All the sizes for data types that I listed in my posting have been verified to be correctby using sizeof() statements.
April 7th, 2010, 03:51 AM
I want to define a C-struct as shown below, which will be written to a message queue:
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 = 'a'
buffer = 0...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.