Oct 16, 2002 #1 jo90 Programmer Jun 19, 2002 30 GB Hi, If i assign the variable find, to the array; arr[1]=find should the following loop only print for( i in arr) print i I can not get this to print the correct values; ie. the value from the variable find. How can I get this to work correctly? Jo
Hi, If i assign the variable find, to the array; arr[1]=find should the following loop only print for( i in arr) print i I can not get this to print the correct values; ie. the value from the variable find. How can I get this to work correctly? Jo
Oct 16, 2002 #2 jamisar Programmer Jul 31, 2002 523 CH on what you are workin on? shell, perl, awk, c .... my be should be for(a = 1; a< elements-of-array; print array[a++]); vox clamantis in deserto. Upvote 0 Downvote
on what you are workin on? shell, perl, awk, c .... my be should be for(a = 1; a< elements-of-array; print array[a++]); vox clamantis in deserto.
Oct 16, 2002 #4 vgersh99 Programmer Jul 27, 2000 2,146 US your 'arr' will contain only ONE element - you keep reassigning the value of 'find' to same element of the array. Change your assignment logic to something like [I don't know the exactl details of your logic]: arr[++ind]=find And then for printing: for (iter in arr) print arr[iter]; vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+ Upvote 0 Downvote
your 'arr' will contain only ONE element - you keep reassigning the value of 'find' to same element of the array. Change your assignment logic to something like [I don't know the exactl details of your logic]: arr[++ind]=find And then for printing: for (iter in arr) print arr[iter]; vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+