05-13-2002
hoe to allocate a 2 dimensions array?
hi .
how can I allocate a 2 dimensions array?
I used :
{
int i;
/* Allocating the rows */
Schedule = (int **)( malloc( sizeof(int*) * (N-2) ) );
if( Schedule == NULL )
{
printf("\nError - couldn't allocate memory! Aborting...\n");
exit(-1);
}
/* Allocating memory for columns */
for( i = 0; i < N - 1; i++ )
{
Schedule[i] = (int *)( malloc( sizeof(int) * N ) );
if( Schedule[i] == NULL )
{
printf("\nError - couldn't allocate memory! Aborting...\n");
exit(-1);
}
}
return;
}
end of quote!
but it doesn't allocate the array .... when I use : "Schedule[0][0] = 1;" , for example , I get "segmetation fault" .
Thanks , Azran .
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have installed perc 2 raid card .in installiation , one is install whole for unix file system,and other select "do not modify"
after installiation ,how to use another ? add filesystem ?how to? (2 Replies)
Discussion started by: luckylwf
2 Replies
2. Programming
Hi Folks
can any body suggest how to allocate virtual memory any function for that (2 Replies)
Discussion started by: munnu
2 Replies
3. UNIX for Advanced & Expert Users
Hi all,
I would like to know how i can mount swap on /tmp at boot time,
I mean even before the actual script that does the mounting kicks in?
i tried this
mount -F tmpfs swap /tmp
(nothing happens it just hangs during the booting)
I also tried this
/usr/lib/fs/tmpfs/mount swap /tmp... (3 Replies)
Discussion started by: wrapster
3 Replies
4. UNIX for Advanced & Expert Users
On SunOS 5.8 I get an error when starting a large Java process with over 2Gb memory.
Error occurred during initialization of VM
Could not reserve enough space for object heap
When stopping several other Java processes we can start this process. This seems to indicate that we don't have... (11 Replies)
Discussion started by: rein
11 Replies
5. Shell Programming and Scripting
Hi,
We are using dimensions 10 (source code control system) for our programs. Some programs contain special characters like ‘$' , ‘#' , ‘ , ‘ etc..
During the check-out process of an item , a unix shell script will be called to process the item. If the item contains a ‘$' character, it will... (0 Replies)
Discussion started by: mrs_rajan
0 Replies
6. UNIX for Advanced & Expert Users
Hi,
I have 2 systems with same hardware and software. One system is giving me error "Error occurred during initialization of VM Could not reserve enough space for object " when I tried to increase JBoss App's heap size to 2GB while the other system is running fine without any issue. Is there... (5 Replies)
Discussion started by: ravi3553
5 Replies
7. Programming
hi
I want to take string as a input from user and the string is very very length. From the lengthy string i have to substring take first 16 letters, then next 8 letters,................... Please guide me how to write program to take lengthy string from user and sub string it.
Thanks (4 Replies)
Discussion started by: atharalikhan
4 Replies
8. Shell Programming and Scripting
Hello to all,
I am very new in the shell scripting and I need help. I have data for several individuals in several rows followed by a tag and by 5 values per row, with the name of the individual in the first column, e.g.:
IND1 H1 12 13 12 15 14
IND2 H2 12 12 15 14 14
IND3 H1 12 15... (2 Replies)
Discussion started by: Bemar
2 Replies
9. UNIX for Dummies Questions & Answers
Hi Experts,
I just want to copy some selected strings from a a file into a new .txt file .
I am using below command to find the data now want to copy the search results into another .txt file please help me .
find /Path -exec grep -w "filename1|filename1|filename1|" '{}' \;... (2 Replies)
Discussion started by: mumakhij
2 Replies
LEARN ABOUT DEBIAN
gpilot-install-file
GPILOT-INSTALL-FILE(1) General Commands Manual GPILOT-INSTALL-FILE(1)
NAME
gpilot-install-file - gnome-pilot file conduit scheduler
SYNOPSIS
gpilot-install-file [--now|--later] files...
DESCRIPTION
gpilot-install-file is a command line tool for scheduling files to be installed on a Palm PDA by the gnome-pilot file conduilt.
OPTIONS
In addition to a list of files to be installed gpilot-install-file takes the following options:
--now Schedule the file(s) for installation and wait for the user to synchronise immediately.
--later
Schedule the file(s) for installation and exit. The files will be installed at the next synchronization.
SEE ALSO
gpilot-applet(1), gpilotd(1), file-conduit-control-applet(1).
AUTHOR
The file installation conduit was written by Eskil Olsen <eskil@eazel.com>. This manual page was written by Mark Brown
<broonie@sirena.org.uk>.
April 30, 2001 GPILOT-INSTALL-FILE(1)