10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
There are many places where I can see the syntax description for optargs, which, usually boils down to this:
getopts OPTSTRING VARNAME
where:
OPTSTRING tells getopts which options to expect and where to expect arguments
VARNAME tells getopts which shell-variable to use for option reporting... (2 Replies)
Discussion started by: sharkura
2 Replies
2. Programming
Dear all,
I am using C and ROOT for programming. And I need to incorporate following in my code.
char *fps=NULL;
int dec=0,sign=0;
float mean = h1->GetMean(1); //0.001298
fps= fcvt(mean,6 , &dec, &sign);
I need to provide this mean as const char to some other function to get... (8 Replies)
Discussion started by: emily
8 Replies
3. Shell Programming and Scripting
Guys,
May i know how can we de reference the code reference variable.?
my $a = sub{$a=shift;$b=shift;print "SUM:",($a+$b),"\n";};
print $a->(4,5);
How can we print the whole function ?
Please suggest me regarding this.
Thanks for your time :)
Cheers,
Ranga :) (0 Replies)
Discussion started by: rangarasan
0 Replies
4. Programming
I am writing some code in C++ to print a message using fprintf
Here is an example
void pr_desc(
FILE* stream,
int shift,
const char* desc) {
const char* format="%*s\e;
fprintf(stream,format,shift,"",desc);
}
I call it using
const char* desc;
... (4 Replies)
Discussion started by: kristinu
4 Replies
5. Programming
Hi
In the following code, why the variable 'i' still retains the value 10 instead of 11? Why it is not possible to alter this variable's value?
int main() {
const int i = 10;
*(const_cast<int*>(&i)) = 11;
cout << i << endl; // Ans: 10
} (6 Replies)
Discussion started by: royalibrahim
6 Replies
6. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
7. Programming
Hi all,
I have some questions about functions.
In a code I have (a .hpp file) there is this line which says:
const Class_1_Name* Class_2_Name::MethodName(int ipart) const {return (ClassName*)_ref_to_method.At(ipart);}
My questions are:
What is the meaning of the two constants,... (2 Replies)
Discussion started by: eager2no
2 Replies
8. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
9. Programming
hi,
what is the difference b/w char in C and C++.and give me the examples.
Thanks...
sarwan (3 Replies)
Discussion started by: sarwan
3 Replies
10. Programming
Can any one explain how the statement '2' in the following statements is a legal one.
int & ref = 3; // Illegal statement - Compiler error.
const int& ref=3 ; // Compile and executes properly.
Thanks in Advance,
Arun (1 Reply)
Discussion started by: arun.viswanath
1 Replies