I have a header declaring functions that take pointers to C++ objects as parameters. The implementaton is in a seperate C++ file. How can I include this header in C and use the functions in C even though the arguments need to be C++ object pointers?
...
What does %.8Ff format specifier in printf do?What does F mean?
...
i want to change this code below for the inwashfile to be able to load from any directory instead of loading from the tech_projects environmental variable.
/**Get projects directory from environment variable****************/
strcpy(pjects.arr, getenv("Tech_Projects"));
pjects.arr[strlen(pjects.arr)] = '\0';
if (strcmp(inwashfil...
I'm new to obj-c and I'm used to creating a property declaration for all my member vars and synthesizing them, just got the hang of it in fact. Along comes a need for a simple C array of a struct I typedeffed myself (I guess the struct aspect doesn't really matter).
Can someone explain what I should be doing with this C array as far as...
Hi all,
I am using SIMD to compute fast exponentiation result. I compare the timing with non-simd code. The exponentiation is implemented using square and multiply algorithm.
Ordinary(non-simd) version of code:
b = 1;
for (i=WPE-1; i>=0; --i){
ew = e[i];
for(j=0; j<BPW; ++j){
b = (b * b) % p;
if (ew...
int x;
Is this declaration or definition ?
As I write the following code,
#include <stdio.h>
int main(void)
{
int x;
printf("%p",&x);
return 0;
}
it prints some address.So as memory is allocated , int x; can't be a declaration. So is it a definition ?
...
I'm trying to find all the paths between 2 nodes in a grid, and the path has to go through all the node from start to end.
Example (Start = S, End = E)
0 0 0
0 S 0
0 0 E
The answer for the above is 2 paths: (ignore the '.''s)
0-0-0
|.......|
0 S-0
|
0-0-E
0-0-0
|......|
0 S 0
|...|...|
0-0 E
I thought of using recursing, but g...
I have following code
#include <stdio.h>
#include<ctype.h>
typedef struct {
int Type;
int Type2;
}foo;
typedef struct {
char cData[40];
}bar;
int main()
{
bar b1;
strcpy(b1.cData,"11");
foo *f=(struct foo *)&b1;
printf("Type is %d \n",f->Type);
return 0;
}
But i am not getting the value of type 1 in f's pointer , i...
Hi everyone,
I'm using libjpeg (C/C++ programming on Windows Mobile 6.5), in order to decode images from an IP camera (sent in a MJPEG stream), before pushing them into a DirectShow graph.
Until now, I've been using a single function for : receiving the stream, parsing it manually (in order to find JPEG data starting- and end-point), d...
Hello!
I'm making a network sniffer for my college project using the libpcap library. Majority of the code works without any problem, however, I'm stuck with the following issue. I've added five command line options using getopt_long() function, but one option doesn't work as expected.
The option is -d (--device_info) and is used to pri...
Greetings.
I am trying to compile a 8hz mp3 encoder - C code in QT Creator.
In a file l3psy.c that starts like this
#include <stdio.h>
#include "types.h"
#include "error.h"
#include "layer3.h"
#include "l3psy.h"
#include "fft.h"
#include "tables.h"
The build step complains about PI being undeclared here
for(i=0;i<BLKSIZE;i++) wi...
Hi. This amu.
I want to write a compiler in C.
Whats basics do I have to learn for creating a compiler?
...
Hii ,
We see suggestions when we type a word in Ms-word , google etc... How do they do that ?
I would like to know how the techniqueslike auto correct , auto complete , spell checking etc.. are performed . HOw are the words actually stored... what algorithms are followed ... ???
Any links that suggest a possible way are welcome,
...
I just wonder how can I switch on the string "B1" ? Don't ask why this string :-)
...
Hi,
I need to serialize C/C++ structure in a binary string,very fast.
Env = Windows,Boost 1.44,Python 2.4.
We have 3 structures differents to serialize:
Basic : int,double,long,float,string (or char*)
Vector:
- Each element can be : Basic or Vector or a Map
--> vector< Basic,Vector,Map >
Map:
- Each Value element c...
It seems to me like a no-brainer, but I cannot find any information against or for it.
From the point of view of demangling etc, I don't suppose this to be a big problem, but I can't figure out, how I can write a little tiny C program which calls a function from a little tiny C++ library.
I am on linux right now, trying with static bin...
Hello all
i looking for a tool that takes long text string to valid const char *fmt
for example i want to set char* with this java script as string:
http://code.google.com/p/swfobject/link text
in simple words i need to properly escape the java script string so i could printf() it later
i hope now its clear
Thanks
...
Hi,
I'm trying to sort a structure I've created via qSort however it seems to be be doing what I expect it to.
This is my compare function
int compare(const void *a, const void *b) {
const INPUT *p1 = a;
const INPUT *p2 = b;
return ((p1->startTime) - (p2->startTime));
}
Where INPUT is my structure and startTime is an int...
Hello, I need a data structure with the following properties:
Access to elements must be very fast
Elements, that are not added, shouldn't take memory (as ideal, size of empty structure near to zero)
Each element has two integer coordinates (x,y) (access to elements only by them)
Max count of elements known at creation time (over 10^3)...
Hi,
I am using Intel Core2Duo E4500 processor. It is supposed to have SSE3, SSSE3 facilities. But if I try to use them in programs it shows the following error "SSE3 instruction set not enabled"
Any ideas?
...