c

C / C++ Library for HTTPS Client with Basic Authentication

Do you recommend any good library or examples online for implementing an HTTPS client that can connect to a website using basic authentication? This is meant to run in linux servers. Any pointers help. Update: Question about the unanimous libcurl - does it come bundled by default in major distributions like Debian, Ubuntu, Gentoo, Slac...

Use of sqlite3_exec

I have the next SQLITE3 commands that generates a file with more than 60 million records: .mode csv .output matppp.csv select mat, ppp from matppp order by mat; .output stdout How can I include these commands into a C program using: sqlite3_exec(db, "..........", NULL, 0, &db_err); ? When I attempt to do it myself, the c program ...

Memory Leak in C

Hello, I am a C beginner, and I am writing a very simple linked-list. I am wondering if there would be a memory leak in the following code: void removeListEntry(struct tableEntry *symp, struct tableEntry *previous) { if (symp->next = 0){ symbolList.tail = previous; previous->next =0; } else { previous->next = symp->next...

struct - sorting a c-string with qsort

I'm sorting a bunch of IPs, but for some reason they come in the wrong order. I'm not quite sure where could be the problem. 66.249.71.3 190.148.164.245 207.46.232.182 190.148.164.245 190.148.164.245 202.154.114.253 190.148.164.245 190.148.164.245 66.249.71.3 190.148.164.245 202.154.114.253 Here it is the wa...

How might I set the bottom 3 bytes of a 4-byte long while leaving the top byte intact?

Relevant code is this: typedef unsigned long int chunk_head; typedef struct malloc_chunk { // Contains the size of the data in the chunk and the flag byte. chunk_head head; // Deliberately left unsized to allow overflow. // Contains the payload of the chunk. unsigned int data[]; }; And just as an example...

Is there any open source comand line library?

I want to add command line interface support to a server program. So each time I want to check server's status, I can telnet to the server's control port, and input command to check the server's status. Is there any open source library implements such functionality so I need not write it from scratch? Further more, if the library can...

Write a Linked List‐based variant of Q2. Following will be the function prototype:

int find(struct node *list, int x, int start); The return value of this recursive function should be the index (position) of x, if x is indeed present in the list. If x is not in the list, it will return ‐1. e.g. if x is the data of the first node, the function should return 0, and so on. ...

strcat query (string.h)

First off : STRCAT : Cplusplus - strcat When clearly the definition says : char * strcat ( char * destination, const char * source ); Why'd they use char str[80] in the example??? Shouldn't they have used a character pointer? ...

Is mysql_insert_id thread safe?

Hi! I'm using MySQL C API to build a db client application, and i need to get the last autoincremented value in a INSERT statement, so mysql_insert_id does. But this client is multithreaded and a piece of code like this: mysql_query(conn, query_string); value = mysql_insert_id(conn); I don't know what will it return, this query auto...

How to get the address of the DNS server that getaddrinfo queries

Hello all, I'm newbie to BSD socket programming in C. I can query a web address to get its associated ip addresses with "getaddrinfo" function. But i want to know which dns server getaddrinfo queries this information from. ...

strange function definition in Scilab<->C interface

Hi there, I'am talking about this example of a Scilab<->C wrapper: http://www.scilab.org/doc/intro/node89.html. The strange part is this one: int intsfoubare(fname) char *fname; { ....(some code) } It is some kind of function defintion but I really don't understand what the char *fname is good for also just fname as par...

Recursive Descent Parser for C

I'm looking for a parser for C. Here is what I need: Written in C (not C++). Handwritten (not generated). BSD or similarly permissive license. Capable of nontrivially parsing itself (can be a subset of C). It can be part of a project as long as it's decoupled so that I can pull out the parser. Is there an existing parser that fulfi...

C - How to justify output lines using printf() to get equal length?

I have two functions, one which produces messages like "Starting initialization..." and the other which cheks return codes and outputs "Ok\n", "Warning\n", or "Error\n". However, produced output is of the different length: Starting initialization...Ok. Checking init scripts...Ok. How can I get smth. like that: Starting initialization...

Is there a javadoc-like program for C/C++?

Some people suggested Doxygen, some ccdoc, which should be more similar to javadoc but is less supported. What's your opinion? ...

Thermometer using DS1620 IC and arm microcontroller

I am working on a project in which I have to use DS1620 IC to display temperature using ARM LPC23xx micro controller. I want to write code in C. I am a newbie in embedded systems and I have to finish this in 24 Hrs. Please help in any way possible. ...

C pointers : pointing to an array of fixed size

This question goes out to the C gurus out there: In C, it is possible to declare a pointer as follows: char (* p)[10]; .. which basically states that this pointer points to an array of 10 chars. The neat thing about declaring a pointer like this is that you will get a compile time error if you try to assign a pointer of an array of d...

How to get value from 15th pin of 32bit port in ARM?

I am using an IC, DS1620 to read 1 bit serial data coming on a single line. I need to read this data using one of the ports of ARM microcontroller (LPC2378). ARM ports are 32 bit. How do I get this value into a 1 bit variable? Edit: In other words I need direct reference to a port pin. ...

What to look for in a candidate with over 8 years of experience in C, C++, Linux Application Development?

I need to interview a candidate with over 8 years of experience in Linux using C/C++. What would be the best way to judge such a candidate? Do I need to test his understanding of algorithms? Do I need to test his programming skills by asking to write a program? How should I test his understanding of Linux? ...

How to read value from GPIO port of an ARM microcontroller?

How do get ARM microcontroller port value into a 32 bit variable. I am using LPC2378 microcontroller. ...

Displaying single digit on a LCD using ARM microcontroller?

I am writing an embedded application in which I need to display a digit on LCD. There must be some pre-existing libraries available doing the same. Or is there some reference code in C-language that could be referred? Microcontroller is ARM based LPC2378. ...