i'm trying to open a file with three or more columns and an undetermined, but finite number of rows. I want to define an array for each row with each element of the row as a sub array. The columns are separated by tabs or spaces.
Here's the file:
12x3.12z34b.342sd3.sds 454.23.23.232 ... (9 Replies)
Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
i'm trying to use awk to count a listing similar to the following and get a report of the listing similar to the one below it.
y,pizza
n,pizza
y,pizza
y,pizza
n,tomato
n,tomato
y,cheese
y,cheese
n,cheese
report
----
pizza,3,1
tomato,0,2
cheese,2,1 (1 Reply)
Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP.
I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Hi,
I was trying to process a file with the help of awk. I want to first display all the rows that contains 01 and at the end of processing I have to print some portion of all the lines. like below.
Output expected: (2 Replies)
My language is C++. I have a multidimensional vector that I would like to sort by a specific "cell" or "field" within the main vector. Does anyone have any information on how to do this? I have searched all over the internet and every reference manual I can find. So far I have found very little to... (2 Replies)
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Hi Experts,
I'm a newbie.....multidimensional arrays in shell scripts is possible???
If so, can anyone guide me with an example.....and also can anyone tell me, how we can create a table like ouput format in shell script....the output should look like this one:
1 2 3 4 5 6
6 5 4 3... (4 Replies)
I have two files:
file-1 is a list of number of interfaces in the switch and file-2 have VLAN-ID , VLAN-NAME , Interface belong to that VLAN like this:
file-1:
1/1
1/2
1/3
1/4
1/5
.
.
file-2:
1,"vlan-wifi",1/1,1/7,1/8 (9 Replies)
I am learning about bash system variables, such as $ , @ and #.
I have this piece of script implementing an array and it is doing its job just fine.
This is not the only array I will be using.
Just for ease of maintenance and more coding I would like to have the arrays in two dimensional... (4 Replies)
Discussion started by: annacreek
4 Replies
LEARN ABOUT DEBIAN
pack_fopen
pack_fopen(3alleg4) Allegro manual pack_fopen(3alleg4)NAME
pack_fopen - Opens a file according to mode. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
PACKFILE *pack_fopen(const char *filename, const char *mode);
DESCRIPTION
Opens a file according to mode, which may contain any of the flags:
`r' - open file for reading.
`w' - open file for writing, overwriting any existing data.
`p' - open file in packed mode. Data will be compressed as it is written to the file, and automatically uncompressed during read opera-
tions. Files created in this mode will produce garbage if they are read without this flag being set.
`!' - open file for writing in normal, unpacked mode, but add the value F_NOPACK_MAGIC to the start of the file, so that it can later be
opened in packed mode and Allegro will automatically detect that the data does not need to be decompressed.
Instead of these flags, one of the constants F_READ, F_WRITE, F_READ_PACKED, F_WRITE_PACKED or F_WRITE_NOPACK may be used as the mode
parameter.
The packfile functions also understand several "magic" filenames that are used for special purposes. These are:
`#' - read data that has been appended to your executable file with the exedat utility, as if it was a regular independent disk file.
`filename.dat#object_name' - open a specific object from a datafile, and read from it as if it was a regular file. You can treat nested
datafiles exactly like a normal directory structure, for example you could open `filename.dat#graphics/level1/mapdata'.
`#object_name' - combination of the above, reading an object from a datafile that has been appended onto your executable.
With these special filenames, the contents of a datafile object or appended file can be read in an identical way to a normal disk file, so
any of the file access functions in Allegro (eg. load_pcx() and set_config_file()) can be used to read from them. Note that you can't write
to these special files, though: the fake file is read only. Also, you must save your datafile uncompressed or with per-object compression
if you are planning on loading individual objects from it (otherwise there will be an excessive amount of seeking when it is read).
Finally, be aware that the special Allegro object types aren't the same format as the files you import the data from. When you import data
like bitmaps or samples into the grabber, they are converted into a special Allegro-specific format, but the `#' marker file syntax reads
the objects as raw binary chunks. This means that if, for example, you want to use load_pcx() to read an image from a datafile, you should
import it as a binary block rather than as a BITMAP object.
Example:
PACKFILE *input_file;
input_file = pack_fopen("scores.dat", "rp");
if (!input_file)
abort_on_error("Couldn't read `scores.dat'!");
RETURN VALUE
On success, pack_fopen() returns a pointer to a PACKFILE structure, and on error it returns NULL and stores an error code in `errno'. An
attempt to read a normal file in packed mode will cause `errno' to be set to EDOM.
SEE ALSO pack_fclose(3alleg4), pack_fopen_chunk(3alleg4), packfile_password(3alleg4), pack_fread(3alleg4), pack_getc(3alleg4),
file_select_ex(3alleg4), pack_fopen_vtable(3alleg4), expackf(3alleg4)Allegro version 4.4.2 pack_fopen(3alleg4)