Sponsored Content
Top Forums Programming Segmentation fault in fopen when in write mode. Post 302672423 by alister on Monday 16th of July 2012 10:49:45 AM
Old 07-16-2012
Hello, shoaibjameel123:

On an unrelated note, I'm curious about something. I've noticed in your last couple of C threads that your main() prototype is using fixed-width integer types. Why are you using int32_t instead of plain int?

On a typical server or desktop system, int32_t is almost certainly a typedef (or a typedef of a typedef) of int anyway, so it doesn't cause a problem (at least until we move to 256 bit systems Smilie). All joking aside, it seems to me an unnecessarily restrictive choice.

Regards,
Alister

Last edited by alister; 07-16-2012 at 11:53 AM.. Reason: typo/grammar
 

10 More Discussions You Might Find Interesting

1. Programming

segmentation fault

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. Programming

Hi! segmentation fault

I have written a program which takes a directory as command line arguments and displays all the dir and files in it. I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
Discussion started by: vijlak
4 Replies

3. 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

4. Programming

segmentation fault

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

5. Programming

Segmentation fault.

I'm getting a segmentation fault. I'm new to Linux programming. Thanks so much for all of your input.:eek: #include </usr/include/mysql++/mysql++.h> #include <stdio.h> #include <iostream> #include <sstream> #include <string.h> using namespace std; int outputToImport(const char*... (1 Reply)
Discussion started by: sepoto
1 Replies

6. 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

7. 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

8. Solaris

Segmentation fault

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. Shell Programming and Scripting

Count Segmentation fault and write to the file

Hi everyone Need to get version of npm application that have several output like this: root: nmp -version 10 root: nmp -version 10 root: nmp-new -version 3.1 root: nmp-old -version Segmentation fault count them , after that write to the file like this: 10 2 3.1 1 (1 Reply)
Discussion started by: indeed_1
1 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
xcb_glx_read_pixels(3)						   XCB Requests 					    xcb_glx_read_pixels(3)

NAME
xcb_glx_read_pixels - SYNOPSIS
#include <xcb/glx.h> Request function xcb_glx_read_pixels_cookie_t xcb_glx_read_pixels(xcb_connection_t *conn, xcb_glx_context_tag_t context_tag, int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format, uint32_t type, uint8_t swap_bytes, uint8_t lsb_first); Reply datastructure typedef struct xcb_glx_read_pixels_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t pad1[24]; } xcb_glx_read_pixels_reply_t; Reply function xcb_glx_read_pixels_reply_t *xcb_glx_read_pixels_reply(xcb_connection_t *conn, xcb_glx_read_pixels_cookie_t cookie, xcb_generic_error_t **e); Reply accessors uint8_t *xcb_glx_read_pixels_data(const xcb_glx_read_pixels_request_t *reply); int xcb_glx_read_pixels_data_length(const xcb_glx_read_pixels_reply_t *reply); xcb_generic_iterator_t xcb_glx_read_pixels_data_end(const xcb_glx_read_pixels_reply_t *reply); REQUEST ARGUMENTS
conn The XCB connection to X11. context_tag TODO: NOT YET DOCUMENTED. x TODO: NOT YET DOCUMENTED. y TODO: NOT YET DOCUMENTED. width TODO: NOT YET DOCUMENTED. height TODO: NOT YET DOCUMENTED. format TODO: NOT YET DOCUMENTED. type TODO: NOT YET DOCUMENTED. swap_bytes TODO: NOT YET DOCUMENTED. lsb_first TODO: NOT YET DOCUMENTED. REPLY FIELDS
response_type The type of this reply, in this case XCB_GLX_READ_PIXELS. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. sequence The sequence number of the last request processed by the X11 server. length The length of the reply, in words (a word is 4 bytes). DESCRIPTION
RETURN VALUE
Returns an xcb_glx_read_pixels_cookie_t. Errors have to be handled when calling the reply function xcb_glx_read_pixels_reply. If you want to handle errors in the event loop instead, use xcb_glx_read_pixels_unchecked. See xcb-requests(3) for details. ERRORS
This request does never generate any errors. SEE ALSO
AUTHOR
Generated from glx.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_glx_read_pixels(3)
All times are GMT -4. The time now is 01:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy