How to find the filesystem block size?
I wanted to know a way to find out wich is the disk's block size through a function or a compiler constant in C.. thanks ...
I wanted to know a way to find out wich is the disk's block size through a function or a compiler constant in C.. thanks ...
Hi folks, I wanted to use DevC++ on Linux, so I've started it with wine and everything is OK until it came to run the file. The C file compiles well and a .exe files generated that is able to run on Linux (without wine) $ file '/media/F6AC746BAC74286F/Dev-Cpp/work/hello_on_nix.exe' /media/F6AC746BAC74286F/Dev-Cpp/work/hello_on_nix.ex...
After exhaustive googling and visiting many forums, I am yet to find a good comprehensive answer for this question. A lot of the forums suggest using the get line istream& getline (char* s, streamsize n ) function. My question is what if I don't know what the length of each line is and cannot predict what the size may be? Also what is i...
If i have an array of coordinates for a path(Such as in a paint program), what is the best way to render the entire path with SDL? I looked at setting pixels individually, but from what i've seen that's a bad idea. I also thought about drawing all the coordinates as SDL_Rect's, but rendering a large list of rect's each frame sounds sl...
An rpc server is given which receives millions of requests a day. Each request i takes processing time Ti to get processed. We want to find the 65th percentile processing time (when processing times are sorted according to their values in increasing order) at any moment. We cannot store processing times of all the requests of the past as...
I was successfully to finally be able to use TUI header from PDcurses library in my C++ project in a previous post here. now in my class I am including the C header: #include "tui.h" tui is in C and has this definition for menu: typedef struct { char *name; /* item label */ FUNC func; /* (pointer to) function */ char *...
Pardon me if this is a "noob" question, I'm overextending myself a bit with this. I'm trying to compile a library written in C for use in an iPhone app I'm developing. I can't seem to figure out how to do this, and I've been searching and trying things for hours. I've tried using an External Build System project, and selecting the fold...
I'm using pure win32. How can I use 24 bit images instead of 8 bit? Thanks ...
Is there an mechanism or trick to run a function when a program loads? What I'm trying to achieve... void foo(void) { } register_function(foo); but obviously register_function won't run. so a trick in C++ is to use initialization to make a function run something like int throwaway = register_function(foo); but that doesn't wo...
Given two arrays A[n] and B[m], how can I find the smallest window in A that contains all the elements of B. I am trying to solve this problem in O(n) time but I am having problem doing it. Is there any well know algorithm or procedure for solving it. ...
Is it ever possible for the C send function to return zero when using TCP sockets? The man page just says that it will return the number of bytes sent, but I am not sure if it will just return -1 when it can't send any data. ...
hello I'm having a hard time understanding pointers and i wondered how can pointers be helpful to us ? ...
Is there C99 faq like c-faq? Is it a good idea to use C99 VLA? When is it appropriate to use VLA compared to malloc/free? (since VLA may blow up stack?) ...
I'm trying to use someone else's [c] code that controls a linux shell over a wireless usb device. It fopen-s files "IReadFromBash" and "IWriteToBash" in the current dir to communicate. It comes with no notes but obviously expects a special file to already exist to facilitate this, and segfaults without them. Is there some obvious way to ...
I am trying to parse an XML file using the SAX interface of libxml2 in C. My problem is that whitespace characters between end of a tag and start of a new tag are causing the callback "Characters" to be executed...Hi All, i.e. <?xml version="1.0"?> <doc> <para>Hello, world!</para> </doc> produces these events: ...
Possible Duplicate: C programming : How does free know how much to free? free() is called to deallocate the memory allocated by malloc() function call. From where does the free() find the information about the no. of bytes allocated by the malloc() function. I.e., how do you conform the no. of bytes allocated by the malloc() a...
hello, can somebody explain why do I receive this error, when I do: int boardAux[length][length] = {{0}}; thanks in advance ...
Hello, gcc 4.4.3 vc++ 2008 I would like to make a timer application would be portable on windows and linux. However, would be suffice to start with. My idea is to start a timer and set it for a specified number of seconds. When the time expires call a callback function. Is that the best way to do this? Many thanks, ...
Hi, given the following code: /* signatures */ int getParams(char params[MAX_PARAM_LEN][MAX_LINE_LEN]); int getVersion(const char params[MAX_PARAM_LEN][MAX_LINE_LEN], const char* tagName ); /* initializing */ char params[MAX_PARAM_LEN][MAX_LINE_LEN] = {}; /* getting parameters */ paramCount = getParams(params); /* OK, p...
I am creating a Rendering Engine. And theres 2 ways of me creating a task management system. Creating my own custom call backs that get called before and after render, Or implementing a task management system in which I would have to derive a class from a parent TaskClass and then throw it into queue. Honestly I feel creating callbacks ...