07-21-2010
More specifically: A pointer is an integer variable that holds a memory address. It takes a small and fixed number of bytes. You're using it to point to memory stored elsewhere.
When you define it as an array, you're telling it that all the memory for that array is stored at the memory address of the pointer, not the memory address stored in the pointer. It expects 80 bytes of data right there, not where it points to.
You could do "extern int arr[]" perhaps. That way you're telling it it's an array, as you'd expect, but the size at least wouldn't have to be known.
10 More Discussions You Might Find Interesting
1. Programming
sometimes for this code i get a segmentation fault for codes llike this
:
int main{
int * a= 0;
int b;
a = (int*)malloc(sizeof(int));
///some code using these variable but no freeing of a
if(a){
free(a);
a = 0;
}
return... (3 Replies)
Discussion started by: wojtyla
3 Replies
2. UNIX for Dummies Questions & Answers
hello all,
I tried a program on an array to intialise array elements from the standard input device.it is an integer array of 5 elements.but after entering the 4th element it throws a message called "Segmentation Fault" and returns to the command prompt without asking for the 5th element.
... (3 Replies)
Discussion started by: compbug
3 Replies
3. AIX
Hi ,
During execution a backup binary i get following error
"Program error 11 (Segmentation fault), saving core file in '/usr/datatools"
Riyaz (2 Replies)
Discussion started by: rshaikh
2 Replies
4. Linux
Hi,
on a linux Red HAT(with Oracle DB 9.2.0.7) I have following error :
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Segmentation fault
What does it mean ? And the solution ?
Many thanks. (0 Replies)
Discussion started by: big123456
0 Replies
5. Programming
Hi,
I am having this segmentation fault not in the following program, bt. in my lab program . My lab program is horrible long so cannot post it here bt. I am using the following logic in my program which is giving the segmentation fault. Bt. if I run this sample program as it is it dosen't give... (3 Replies)
Discussion started by: mind@work
3 Replies
6. Programming
i have this code
int already_there(char *client_names, char *username) {
int i;
for(i = 0; i<NUM; i++) {
printf("HERE\n");
if (strcmp(client_names, username)==0) return(1);
}
return(0);
}
and i get a segmentation fault, whats wrong here? (7 Replies)
Discussion started by: omega666
7 Replies
7. Programming
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies
8. Solaris
Hi Guys,
I just installed and booted a zone called testzone. When I logged in remotely and tried changing to root user I get this error:
"Segmentation fault"
Can someone please help me resolve this?
Thanks alot (2 Replies)
Discussion started by: cjashu
2 Replies
9. Programming
I keep getting this fault on a lot of the codes I write, I'm not exactly sure why so I'd really appreciate it if someone could explain the idea to me.
For example this code
#include <stdio.h>
main()
{
unsigned long a=0;
unsigned long b=0;
int z;
{
printf("Enter two... (2 Replies)
Discussion started by: sizzler786
2 Replies
10. Programming
Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1...
I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one.
Below are two very condensed snippets of which I have added the results inside the each code section.
IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
LEARN ABOUT DEBIAN
djvu2hocr
DJVU2HOCR(1) djvu2hocr manual DJVU2HOCR(1)
NAME
djvu2hocr - DjVu to hOCR converter
SYNOPSIS
djvu2hocr [option...] djvu-file
djvu2hocr {--version | --help | -h}
DESCRIPTION
djvu2hocr converts hidden text from a DjVu file to the hOCR[1] format.
OPTIONS
Text segmentation options
--word-segmentation=simple
Use the same word segmentation as found in the DjVu file.
This is the default.
--word-segmentation=uax29
Use the Unicode Text Segmentation[2] algorithm to break lines into words, possibly fixing word segmentation found in the DjVu file.
Other options
--version
Output version information and exit.
-h, --help
Display help and exit.
PORTABILITY
djvu2hocr uses a custom extension to hOCR to retain characters which cannot be directly represented in an HTML/XML document. For example,
control character BEL (^G, U+0007), is converted into the following HTML chunk: <span class="djvu_char" title="#x07"> </span>
SEE ALSO
djvu(1)
AUTHOR
Jakub Wilk <jwilk@jwilk.net>
Author.
NOTES
1. hOCR
http://docs.google.com/View?docid=dfxcv4vc_67g844kf
2. Unicode Text Segmentation
http://unicode.org/reports/tr29/
djvu2hocr 0.7.9 03/10/2012 DJVU2HOCR(1)