how to catch a parameter that is of the wrong type
Hi there,
Here is the prototype for the myConcat function which takes a variable number of arguments. I am to create a file that contains a definition of the myConcat function.
char* myConcat(int n, ... )
When the function is called, the first argument should be an integer > 0.
The other arguments should all be of type char* and are expected to point to '\0'-terminated sequences of chars. The first argument indicates how many "string" arguments are passed. myConcat should return the concatenation of these strings.
Note that the file must not contain a main() function. The only names visible outside the file (when it is compiled together with other .c files) should be "myConcat".
How do I make sure that the proper arguments have been passed to myConcate? For example myConcate(3, "Hello", "There", "!") would be correct, but myConcate(3, "Hello", 5.0, "There") should generate some kind of error because 5.0 is not a pointer to char.
Also, is there anything I have to do to make sure that the only names visible outside the file should be "myConcat"?
Thanks to anyone whose able to give me some kind of hint!
Magda
Have you tried running the command below? On the same RHEl 6.8 or 6.6. It will give you different output.
find . -maxdepth 1 -ctime -7 -type f
rpm -qa|grep find
findutils-4.4.2-9.el6.x86_64
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)
# (6 Replies)
Hi ! all I am just trying to check range in my datafile
pls tell me why its resulting wrong
admin@IEEE:~/Desktop$ cat test.txt
0 28.4
5 28.4
10 28.4
15 28.5
20 28.5
25 28.6
30 28.6
35 28.7
40 28.7
45 28.7
50 28.8
55 28.8
60 28.8
65 28.1... (2 Replies)
i am passing input parameter 'one_two' to the script , the script output should display the result as below
one_1two
one_2two
one_3two
if
then
echo " Usage : <$0> <DATABASE> "
exit 0
else
for DB in 1 2 3
do
DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}`
done
fi (5 Replies)
Hi
I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/
Can anyone please help me on this? (3 Replies)
Dear colleagues,
One of my friend have a problem with c code. While compiling a c program it displays a message like
"array type has incomplete element type". Any body can provide a solution for it.
Jaganadh.G (1 Reply)
Say I write something like the following:
var1=1
var2=2
for int in 1 2
do
echo "\$var$int"
done
I want the output to be:
1
2
Instead I get something like:
$var1
$var2 (2 Replies)
Hi all
I have a script which will take input as filename and passes it to a java program. It is as follows
--------------------------------
FILENAME=$1
echo $FILENAME
${JAVA_HOME}/bin/java -cp DateProvider $FILENAME
-------------------------------------------------
when I execute the same... (2 Replies)