assign array with a local var???


 
Thread Tools Search this Thread
Top Forums Programming assign array with a local var???
# 8  
Old 04-05-2011
Quote:
Originally Posted by Corona688
The compiler treats constant variables as constants, which was what I'd hoped would allow this assignment behavior.
Yes, but the OP seems interested in standards conformance and whether another compiler would compile this code the same. It probably would thouch (especially in c99).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assign two dimensional array in bash at once

Hi, I have a 10*10 two dimensional array. How do I assign value to all it's 100 elements at once? I don't want to open two for loops and assign one by one. Thanks, Amit (2 Replies)
Discussion started by: amit14august
2 Replies

2. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

3. Shell Programming and Scripting

Assign value to array separated by #

Hi all , I have a string like para1#para2#para3 i want to assign para1 as first element para2 as second and so on i tried IFS=# set -A array para1#para2#para3 echo ${array} para1 para2 para3 i want echo ${array} para1 (2 Replies)
Discussion started by: max_hammer
2 Replies

4. UNIX for Advanced & Expert Users

assign array with a local var???

topic moved to programming (0 Replies)
Discussion started by: zing_foru
0 Replies

5. Shell Programming and Scripting

assign value to array variable

Hi, I have a piece of code as follows: i=0 while read LINE do var = "$LINE" i=$((i+1)) echo "${var}" done < file I want to assign value to the array var. However, when i execute the script i get a error. Please can you help me know what i am missing. I ultimately want to... (2 Replies)
Discussion started by: sunrexstar
2 Replies

6. Shell Programming and Scripting

assign var with set=a[5] not working

Hi Experts, I'm having issue in assigning var with special character , please see below for complete details. $ echo $SHELL /bin/csh $ cat bp abd/asd/a $ awk -F "/" '{print $NF}' bp | awk '{print $1}' a $ set a=`awk -F "/" '{print $NF}' bp | awk '{print $1}'` $ echo $a ... (15 Replies)
Discussion started by: novice_man
15 Replies

7. Shell Programming and Scripting

How to assign a variable to an array

I want to ask the user to enter an X amount of file names. I want to put those names into an array and then loop back through them to verify they are in the directory. 1st- How would I assign the value to an array and what is the correct syntax. 2nd- how would i reference that array after I... (3 Replies)
Discussion started by: tvb2727
3 Replies

8. Shell Programming and Scripting

Assign words in a string to array

I have a string as "yes why not" I want to create one array variable with contents as one word per place in array.. for above string,the array variable should contain... x="yes,why,not" x = yes x = why x = not Please help me,I am stuck up in the problem since 2 days... (3 Replies)
Discussion started by: uday26
3 Replies

9. Shell Programming and Scripting

SSH script. (Assign $var to free cmd) ???

Running: GNU/Linux, 2.6.22.9-61.fc6 (hope that's the right info needed) I am trying give the amount of RAM and the % used. I am using free command. I am having some problems with this command code: 1)T = `free | grep Mem | awk '{print $2}'` F = `free | grep Mem | awk '{print $4}'`... (3 Replies)
Discussion started by: AngelFlesh
3 Replies

10. Shell Programming and Scripting

assign awk array with printf

I am trying to assign a awk array for further processing later in the script. I can't seem to figure it out. If someone could look at this and help me, I would very much appreciate it. Thanks in Advance. for ( x = 1 ; x <= Var ; x++ ) { if ( x in varr ) { ... (2 Replies)
Discussion started by: timj123
2 Replies
Login or Register to Ask a Question
request_scroll(3alleg4) 					  Allegro manual					   request_scroll(3alleg4)

NAME
request_scroll - Queues a hardware scroll request with triple buffering. Allegro game programming library. SYNOPSIS
#include <allegro.h> int request_scroll(int x, int y); DESCRIPTION
This function is used for triple buffering. It requests a hardware scroll to the specified position, but returns immediately rather than waiting for a retrace. The scroll will then take place during the next vertical retrace, but you can carry on running other code in the meantime and use the poll_scroll() routine to detect when the flip has actually taken place. Triple buffering is only possible with certain drivers: you can look at the GFX_CAN_TRIPLE_BUFFER bit in the gfx_capabilities flag to see if it will work with the current driver. RETURN VALUE
This function returns zero on success, non-zero otherwise. SEE ALSO
poll_scroll(3alleg4), request_video_bitmap(3alleg4), gfx_capabilities(3alleg4), scroll_screen(3alleg4) Allegro version 4.4.2 request_scroll(3alleg4)