User Profile
Collapse
-
He used apostrophes, I just did copy and paste. Thanks for the explanation, it highlighted me a lot. -
Explanation on preprocessor directive
Can someone explain for me what this guy is doing here. N.B homer_uint64 is a defined data type
#define CLUSTERS_DATAID ((homer_uint64) 'CLUS' << 32 | (homer_uint64)' TERS') -
Problem understanding a line in a code
Hello Team,
I extracted this line from a code and I have problems understanding it. I dont understand the use of ' ' and of << on this line. Can someone explain to me.
#define CLUSTERS_DATAID ((homer_uint64) 'CLUS' << 32 | (homer_uint64)' TERS') -
-
Any function that is defined below the main function should have its function prototype declared before the main function. Otherwise you should define (or write) all your functions before defining main function.Leave a comment:
-
Obvious error:
Firstly you forgot to put the return type of binomial; you should do this
int binomial(int n, int k)
{
//your function goes here
}
Secondly, the return type of binomial is integer so this statement
if (n < k)
return("Error") ;
}
is wrong. you should return a number not "Error"
Others then should be logical...Leave a comment:
-
First of all I know how to use pthread_t and I want to know why the compiler does not recognize pthread_id_np_t .
Secondly there is some import behavior I want to observe from that code and reuse it. I don't have to reinvent the wheel.
Thirdly posix thread are compiled with -pthread (http://www.llnl.gov/computing/tutorials/pthreads/)Leave a comment:
-
Error pthread_id_np_t undeclared
Dear team,
I am using posix thread and I downloaded example that I want to test. However the compile complains that:
`pthread_id_np_ t' was not declared in this scope
I have done:
#include <pthread.h>
and I compile as follow:
g++ -pthread example.cxx
How I can solve this problem? -
Waking up a POSIX thread with a signal
Hi Guys,
I am very new to pthreads. I have two pthreads, the writer and the reader thread. I want to be able to wake up the reader thread with SIGUSR1 after writing to the stack.
CAN YOU PLEASE GIVE ME SOME LINKS I CAN READ ABOUT HOW TO DO THIS OR ANY LINKS TO PREVIOUS POSTS THAT DISCUSS THIS. ANY HELP WILL BE APPRECIATED. -
What is make _mkdir? Or you want to use mkdir command of linux? Then you should consider using the function system()Leave a comment:
-
Compiling error
Hi guys,
I have a class declared and defined in AliHLTMessageQu eue.h and AliHLTMessageQu eue.cxx respectively
template<typena me MessageType, int kSignalNumber = SIGUSR1>
class AliHLTMessageQu eue{.//declarations etc..}
I also have a file queueTest.cxx where i call AliHLTMessageQu eue methods.
I declare my object like as:
AliHLTMessageQu eue<int> queue(20000000) ;
And I made... -
Constant pointer error
Hi Guys,
I have have a class called person and it has a method called say() and this is how I declare its object:
[CODE=c++]
const person * a;
a->say();
[/CODE]
This peace code gives me this error:
error: passing ‘const person’ as ‘this’ argument of ‘void person::say()’ discards qualifiers
I DON'T SEE WHY THIS IS WRONG, CAN YOU PLEASE HELP. -
grep
Hi Guys,
I am using using grep to look for certain patterns in files and it can't give me the output I want. I know that the pattern,
TMatrixT<double >::Determinant( ) Const
is there in the file I am searching but grep can't find it. How I should I pass this pattern to grep, i.e which options to use. I tried several options, it does not work -
hidden characters in a string
Hi Guys,
I am reading a file (say file1) to extract strings and use them to search the lines in file2 that contain them. I get an error that the strings are not there in file2 but I know that they are there. When I just use grep on the command line and type the string of an interest and file2 as an input file I get the corresponding line.
I HAVE A FEELING THAT PYTHON IS INSERTING EXTRACT HIDDEN CHARACTERS WHILE READING... -
Symbol defination
Hi Guys,
What is actual meaning of the term symbol in the context of computer programming or computer science. E.g sometimes one gets compile error like "Undefined external symbol main", and it is also said that the nm command in linux list symbols from object files. -
-
Let me be specific; The following piece of code does not compile:
[CODE=cpp]
#include <iostream>
using namespace std;
class Test
{
public:
Test(char * file = "galice.roo t");
void Show()
{
}
};
...Leave a comment:
-
Intializing the method's parameter list
Hi Guys,
What is the advantage of intializing the parameter list of the method, e.g
[CODE=c++]
class ReadFile
{
ReadFile(const char* filename = "Mystuff.tx t")
{
// Function defination goes here
}
// Define the rest of the class here
}
[/CODE]
I am asking this because having that I still have to pass the file name... -
Learn a proper use of while loop, also learn who to use break and continue statements. I have modified your code alittle bit
[CODE=c++]
cout << "Enter a number greater than 10: ";
while (true) {
cin >> integer;
if(integer==10)
{
cout << "That number is equal to ten" << endl;
cout << "Enter a number greater than...Leave a comment:
-
where do you get stuck? Read posting guidelines for this site pleaseLeave a comment:
No activity results to display
Show More
Leave a comment: