Hi I have written a code based upon a requirement.
(field1_6)*(field2_30)*(field3_16)*(field4_16)*(field5_1)*(field6_6)*(field7_2)*(field8_1)*.....
this is one bucket(8 fields) of data. we will receive 20 buckets at a time means totally 160 fields.
i need to take the values of field3,field7 & fields8 based upon predefined condition.
i...
I am trying to execute following code which is the 1988 entry of Obfuscated C Code Contest.
#define _ -F<00||--F-OO--;
int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
{
_-_-_-_
_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-...
Is there a platform-independent C/C++ library that can draw simple "graphics" in pure ASCII in a console program? For example (VERY roughly) I could call a function in the library like rectangle(3, 6); to get the following output:
******
* *
******
Ultimately, I would love to be able to plot simple graphs based on input data tables...
tell me about the best database connectivity support library framework for c c++
...
how to send return(enter button) character through program in windows c/c++? I want to send an external program "user name" with enter button through pipe but "\n" and "\r" and EOF are not working..
...
I'm having some trouble with the 'if(S_IFDIR(stbuf.st_mode))' line. Is this the correct way to test for a directory to recurse into? The function at the moment seems to do it right for 1 or 2 loops and then fails and segmentation faults.
I've tried the following and probably more as the condition.
S_ISDIR(st_mode)
((st_mode & ST_IFMT) ...
I see the following code fragment in a legacy application that accesses Informix through C. Can anyone explain what the SQL in the code is trying to achieve? Thanks.
EXEC SQL BEGIN DECLARE SECTION;
int i_tableref;
EXEC SQL END DECLARE SECTION;
/* Some code here */
if (!i_sel_ref)
{
exec sql begin declare section;
const char *sql...
Please tell mw how to convert a TCP IP socket into NON Blocking socket. I am aware of the fcntl() function but I heard that they are not always reliable.
...
I had come across the following code:
typedef struct {
double x;
double y;
double z;
} *vector
Is this a valid type definition? The code compiles and runs fine. I was just curious if this is common practice.
...
I get the following error in my C program:
Writing to heap after end of help buffer
Can you tell me what I'm missing?
char * path_delimiter(char * path)
{
int i = 0, index = 0, size = 0, length = (int)strlen(path);
char *tmp, *ans;
for(; i < length; i++) {
if(path[i] == PATH_DELIM[0]) {
break;
...
I'm looking for a (preferably open source) tool that, given a large body of C/C++ code, will generate a visual or maybe XML graph of dependencies between classes (C++) and/or files (C).
The idea would be that, if you had to convert the code to another language, you'd like to be able to get the lowest level classes compiling first, and b...
I'm on Windows XP with Cygwin, and I've compiled a DLL that overrides some pthread functions, e.g. pthread_create. LD_PRELOADing this library into a Cygwin application should make this application use my functions instead of standard ones. (See [1].) However it does not happen.
I know that the library is loaded, because I've put printf ...
I do a lot of embedded development work in C. I'm looking for an IDE that can give me the same kind of features as Eclipse or Visual Studio. In the past I've used Vim, but I'm just not happy with the amount of work it is to use. Right now I'm trying to use Eclipse, but I can't get it to tag my code correctly. I also have access to Visual...
I have this huge switch case with nested switch case statements in it that I was wondering if anyone had any ideas on how to clean up?
switch (datatype) {
case STR:
{
switch(operation)
{
case EQUALS:
{
/* perform str compare */
}
case ...
Suppose you have some source code that comes from the unix world. This source consists of a few files which will create a library and a lot of small .c files (say 20 or so) that are compiled into command-line tools, each with their own main() function, that will use the library.
On unixy systems you can use a makefile to do this easily...
I have code in my header file that looks like:
typedef struct _bn bnode;
I can do
bnode b;
just fine, but
b[i], where i is an int gives me the following error:
invalid use of undefined type ‘struct _bn’
Any ideas?
...
Hi. I want to capture packets going out of my machine, and I'm using libpcap (version 1.0.0-1) for the same. The problem is, that a basic program like this -
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[]) {
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
...
I have a C++ Windows application continually updating lat, long and altitude.
I would like my application to incorporate Google Earth to visually "track it".
Any advice or pointing in the right direction would be appreciated.
Thanks.
...
Is there a reliable way to declare typedefs for integer types of fixed 8,16,32, and 64 bit length in ISO Standard C?
When I say ISO Standard C, I mean that strictly:
ISO C89/C90, not C99.
No headers not defined in the ISO standard.
No preprocessor symbols not defined in the ISO standard.
No type-size assumptions not specified in the ...
I apologize if this question has been asked before. I did a rather extensive search for similar questions, however all I could find were answers related to C++ or C#. I'm using GNU C.
I'm writing a daemon that needs to be able to send e-mail using SMTP. I need to be able to login to an external mail server, send the email and interpret ...