Questions for c


6653

how to read contents of a structure using fread() in c

I have the following code where I am trying to read the content of a file and display it and also write to another file. My problem is the content i get on the screen is completely different from ...
8586

Replacing Characters in C

This is part of a lab assignment
5376

Why is forking slowing down my application

My application takes a checkpoint every few 100 milliseconds by using the fork system call. However, I notice that my application slows down significantly when using checkpointing (forking). I test...
5375

I need help converting my driver user interface code

I have a custom driver I have written.
2500

How to dynamically load often re-generated c code quickly?

I want to be able to generate C code dynamically and re-load it quickly into my running C program.
9452

Problem with Arduino and pySerial

I got a problem. I recently bought an Arduino Uno board. I tried to make something funny like controlling an input from my computer. I used Python with pySerial and the program is the following:
7230

How to add a question mark to the end of a line?

I want to check to see if the user added a ? to the end of the buffer. If not, I want the program to add one automatically. This is what I have so far. I dont know what to do next.
9993

Catch “The program stopped working” on Vista

On Vista, I got a problem with the application crash handler. Basically, if something unexpected occurs which cannot be captured by SEH, I get this pop-up window with "The application stopped worki...
1677

How many asm-instructions per C-instruction?

I realize that this question is impossible to answer absolutely, but I'm only after ballpark figures:
5724

Linux-MIPS syscall-saved registers?

Which registers are saved across syscalls (not function calls, the actual round-trip to kernelspace via the syscall instruction) on Linux/MIPS?
5608

Applying malloc

guys... can u help me apply malloc in my code... here's my code:
5128

Pushing data from a structure into a stack in C

The task of the program is to push all the data from a structure into a stack, using memcpy.
3411

Which is the best way to update a record of a file in c?

I have a struct similar to the usually used student struct and I am storing multiple records in a file. I want to be able to update the fields inside the file but I am not sure which way is the bes...
2252

How do I zip a directory or multple files with zlib, using C/C++?

I did search for this topic, but I didn't find any relevant clue for this.
3078

Commonly Accepted Variable Name Formatting - C/C++

I realize that this can be a matter of preference, but I have noticed that variables names in a lot of code samples I've seen have a prefix of g_, s_, m_, or just _. Is this a commonly accepted
3611

PCSC reader emulator

I need an software emulator PC/SC reader for Linux, but can't find.
1459

How do I tell valgrind to memcheck forked processes?

I have a process x that I want to check for leaks with valgrind. The problem is that x is run by y, and y in turn is run by z. I can't run x standalone because y and z setup the environment for x...
4979

readability of long int v. long

Which is more clear to someone reading code? "long" or "long int". "long int" is more descriptive, but "long" is more succinct.
7471

Erasing a Char

Okay i am working on someone elses code. They do alot of this:
1705

Segfault on very simple source

I'm trying to write a simple script using the FreeType library. The segfault is occurring during execution of the FT_Set_Pixel_Sizes method, though I'm using it correctly. Any help would be great. ...
1229

Embedded Parser Memory Use XML vs JSON vs?

I have an embedded weberver which is currently used to administer various bits of hardware over a network.
9107

Shifting elements in an array in C — pointer-based

So I'm trying to learn C right now, and I have two functions: one that shifts elements in an array:
8147

Compare user input with text file in C

I need to have a user input a word then compare the word with a text file to see if it is correct. The user has 3 attempts to enter the word before the program terminates. My issue is reading the w...
3441

trees data structure implementation in c

this code was perfectly working when i was using integers now
3435

Disabling WinAPI

I'm building a game where each player must program his bot. The key idea is that the player will program in C (or C++, or whatever compatible language), build a DLL and send this DLL to the server,...
4558

inet_aton() returning success for invalid ip addresses?

I am looking for some function to verify that if given string is a valid ipv4 address,
2282

Reading file into char array in C: Or how to dynamically allocate an array?

Using Linux system calls open and read. The read call accepts 3 parameters
3998

What does it mean when string 1 is “less than” string 2 in C?

In the documentation of the strncmp(const char *s1, const char *s2, size_t n) function of the XC8 compiler, I read:
7479

How the function do_raw_spin_lock is implemented in linux

While debugging panic issue realted to spinlock, I came across this definition of spinlock in
3933

OpenCV - is there anething like delete text?

I need such thing because it seems to me that when I do
6702

Is there a compiler or IDE for C on Windows that's regarded as an industry standard?

Taking advice from this post, I purchased a copy of 'The C Programming Language' and am happily reading my way through.
2673

How do I create a sqllite3 in-memory database?

One of the appropriate uses for sqlite3 is "in-memory databases". This sounds like a really useful tool for my C++ applications. Does anyone have an example of how this is done in C or C++? I'm
2594

Can't pass pointers to scanf(“%s”,ptr);

So I commented out the scanf part (and just initialized it with my own string), why does it crash if I use scanf? I believe the actual arguments I've put in scanf(); are correct.
6366

Sonar : any feedback?

I am currently doing a little study over Sonar and (why not) other tools to manage code quality.
2535

QDevelop problem debugging location pointer disappears

I am having a problem with QDevelop version 0.27. When I debug the location pointer jumps around without the IDE following it and showing me where it went. I have to manually click through the source
6416

Compiling 64 bit DLL for JNI

I want to include a C library in my Java project via JNI. I wrote the necessary JNI wrapper code and I have compiled and tested it in a Linux environment using gcc and make. Now I need to compile t...
8058

Reposition rectangle after zooming

I have a rectangle defined by R1:x1,y1-x2,y2 and after applying zoom, I get the
8424

How to search common passwords from two given files of size 20GB?

i have two files of size 20GB. i have to remove common passwords from either of one file.
8459

UTF-8 string size in bytes

I need to determine the length of UTF-8 string in bytes in C. How to do it correctly? As I know, in UTF-8 terminal symbol has 1-byte size. Can I use strlen function for this?
1302

Testing embedded spaces in c

I want to create a function in C programming, which will test for the embedded spaces in C.
9538

Handling multiple recv() calls and all possible scenarios

I am fairly new to C and writing a TCP server, and was wondering how to handle recv()'s from a client who will send commands that the server will respond to. For the sake of this question, let's ju...
3920

Parent and Child address space confusion

Its obvious that we have a code block like
7714

CreateFileMapping() fails for Volume

I'm having problem with mapping part of volume to memory. Volume is opened successfully, I can read from it, but CreateFileMapping() fails. GetLastError() returns 87, which has following meaning: "...
4896

information on TAP and TDD for 'C'

I am precisely looking for the info like ,
4056

Typedef struct pointer to function (C)

I am trying to pass a typedef struct pointer to a function and the compiler is complaining with this error message: error: unknown type name ‘RootP’. Here is the code...
2984

Multi Pointer X (MPX) support

I'm wondering how multiple pointers should/could be handled by a high level application.
2680

ld: library not found for -lplot

I am new here. I recently installed plotutils-dev on my mac using fink, but when I try to compile a little program I have by doing
1998

How would you implement the pilloried function in the Daily WTF?

The Daily WTF for 2008-11-28 pillories the following code:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.