nested-loops

PHP Looping through an array with strings AND an array inside

Hi all, This is a basic looping question but with a twist, so it's likely that i'm missing something easy - apologies in advance... I'm trying to pull the results from an array $testoutput - which is filled with 3 arrays: Running the following code: foreach ($testoutput as $ID => $Array) { echo $Array . "<BR>"; } Returns: ARRAY ...

C++ templates to make several version of function with different constant

Hello Can I use template to create several instantiations of some function, different only in some constant parameter? The number of alternatives for this parameter is fixed. E.g. I want not to rewrite (where upper is in 1..32 in powers of two) funct(param, int upper) { some_loops(..) some_heavy_code_fast_for_const_and_slow_f...

Help in Pascals triangle

The following code snippet prints the Pascals triangle,I have got this snippet from the internet but I am unable to get the formula for bin.If anyone can help me out with it I would be thankfull\ #include<stdio.h> int main() { int bin=1,p,q=0,r,x; clrscr(); printf("Rows you want to input:"); scanf("%d",&r); printf("\...