Sponsored Content
Top Forums Programming why I am gettin a segmentation fault when using pointers Post 302165816 by user_prady on Saturday 9th of February 2008 03:32:50 AM
Old 02-09-2008
Bug

Quote:
Originally Posted by Franklin52
You must assign the address of the variable to the pointer this way:

Code:
input_re_see = &input_re;

instead of:

Code:
*input_re_see = input_re;

Google on "pointers tutorial".

Regards
Thank you Franklin for encouragement ..
Actually I am learning those stuffs , and

I thought my programme is right bcoz i followed a func in a book

[code]

void swap(float *d1, float *d2){
float temp;
temp = *d1;
*d1 = *d2;
*d2 = *temp;
}
[\code]

Thats why I ve done like that.. Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Segmentation Fault

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

2. AIX

Segmentation fault

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

3. Programming

Why not a segmentation fault??

Hi, Why I don't receive a segmentation fault in the following sample. int main(void) { char buff; sprintf(buff,"Hello world"); printf("%s\n",buff); } If I define a buffer of 10 elements and I'm trying to put inside it twelve elements, Should I receive a sigsev... (22 Replies)
Discussion started by: lagigliaivan
22 Replies

4. UNIX for Dummies Questions & Answers

Segmentation Fault

Hi, While comparing primary key data of two tables thr bteq script I am getting this Error. This script is a shell script. *** Error: The following error was encountered on the output file. Script.sh: 3043492 Segmentation fault(coredump) Please let me know how to get through it. ... (5 Replies)
Discussion started by: monika
5 Replies

5. Programming

Segmentation fault in C

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

6. UNIX for Advanced & Expert Users

segmentation fault with ps

What does this mean and why is this happening? $ ps -ef | grep ocular Segmentation fault (core dumped) $ ps -ef | grep ocular Segmentation fault (core dumped) $ ps aux | grep ocular Segmentation fault (core dumped) $ ps Segmentation fault (core dumped) $ pkill okular $ ps... (1 Reply)
Discussion started by: cokedude
1 Replies

7. UNIX for Dummies Questions & Answers

Segmentation fault

#include<stdio.h> #include<malloc.h> #include<unistd.h> #include<stdlib.h> void *start_1(void *argv) { printf("thread 0x%x\n",(unsigned int)pthread_self()); pthread_exit((void*)1); } void *start_2(void *argv) { printf("thread 0x%x\n",(unsigned int)pthread_self()); return (void*)2; }... (2 Replies)
Discussion started by: vincent__tse
2 Replies

8. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

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

9. Programming

Segmentation fault

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

C. To segmentation fault or not to segmentation fault, that is the question.

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
TV_REMOVE_SOME_OVERLAPPING(1p)				User Contributed Perl Documentation			    TV_REMOVE_SOME_OVERLAPPING(1p)

NAME
tv_remove_some_overlapping - Remove some overlapping programmes from XMLTV data. SYNOPSIS
tv_remove_some_overlapping [--help] [--output FILE] [FILE...] DESCRIPTION
Read one or more XMLTV files and write a file to standard ouput containing the same data, except that some 'magazine' programmes which seem to contain two or more other programmes are removed. For example, if 'Schools TV' runs from 10:00 to 12:00, and there are two programmes 'History' from 10:00 to 11:00 and 'Geography' from 11:00 to 12:00 on the same channel, then 'Schools TV' could be removed. A programme is removed only if there are two or more other programmes which partition its timeslot, which implies that it and these other programmes must have stop times specified. To avoid throwing away any real programmes, no programme will be discarded if it has content data other than title and URL. Filtering this tool won't remove all overlapping programmes but it will deal with the 'big magazine programme containing smaller programmes' data commonly seen from listings sources. --output FILE write to FILE rather than standard output SEE ALSO
xmltv(5). AUTHOR
Ed Avis, ed@membled.com perl v5.14.2 2004-01-01 TV_REMOVE_SOME_OVERLAPPING(1p)
All times are GMT -4. The time now is 08:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy