passing a variable inside a variable to a function

I would like to know how to pass a variable inside a variable to a function.

sample code below
--------------
for x in 1 9
do
check_null $C$x ##call function to check if the value is null
if [ $? -eq 1 ]
then
echo "line number:$var_cnt, message: field is not null"
fi
done
--------------
C1 has a value, as does C9

I need to pass values stored in C1 and C9 to the function

Any help would be highly appreciated.

Thanks

Ah, you want the shell to parse "$C$x" as "$C1" but instead it is doing "$C" + "$x". So, you need to force it to evaluate $x first.

# C1=abc
# x=1 
# echo $C$x
1
# eval echo \$C$x
abc

Is that what you were looking for?

Yes, I believe thats the way to do it, but how to call the function using the above ? (BTW, thanks for your post)