Please look at this peice of code :-
#include<stdio.h>
int main()
{
int arr[2][2]={1,2,3,4};
printf("%d %u %u",**arr,*arr,arr);
return 0;
}
When i compiled and executed this program i got same value for arr and *arr which is the starting address of the 2 d array.
For example:- 1 3214506 3214506
My question is why does dereferencing a...
Statement in program:
fprintf(OutBasalArea,"\t %12.2lf",SpecBasalArea[ks]);
Getting -1.#J
Why and what change do I need to make to program statement?
...
Ok so here's what i have so far:
#include <stdio.h>
#include <math.h>
//#define PI 3.14159
int factorial(int n){
if(n <= 1)
return(1);
else
return(n * factorial(n-1));
}
void McLaurin(float pi){
int factorial(int);
float x = 42*pi/180;
int i, val=0, sign;
for(i=1, sign=-1; i<11; i+=2){
sign *= -1; // alternate...
what does the extension of the core dump mean and how to read it ? As in when i open the file in text editors i get garbage values .
...
I'm trying to create a binding to libpython using scheme's FFI. To do this, I have to get the location of python, create the ffi-lib, and then create functions from it. So for instance I could do this:
(module pyscheme scheme
(require foreign)
(unsafe!)
(define (link-python [lib "/usr/lib/libpython2.6.so"])
(ffi-lib lib))
...
I seem to be having a problem with a macro that I have defined in a C program.
I compile this software and run it sucessfully with the MIPS compiler.
It builds OK but throws the error "Segmentation fault" at runtime when using icc.
I compiled both of these on 64 bit architectures (MIPS on SGI, with -64 flag and icc on an intel platfor...
I get the following errors:
error: missing terminating " character
and
error: stray `\' in program
In this line of C code:
system("sqlite3 -html /home/user/.rtcom-eventlogger/el.db \"SELECT service_id, event_type_id,free_text, remote_uid FROM Events WHERE remote_uid=\'%d\' ORDER BY start_time DESC;\" > lol.html", nr);
"nr" is a...
I'v been reading about how tooltips work and it seems like I need to register each tool to the window. My issue is, I have a custom color wheel and I want it to show the tooltip for the rgb, hsv etc of that coor which means I won't be registering multipule tools. From the looks of it, the tooltip works with a string resource, and needs e...
Is it possible to take an object file (like a macintosh dylib or a linux .so file), and automatically generate a C .h file?
...
Is it possible to define my own functions in OpenCL code, in order that the kernels could call them? It yes, where can I see some simple example?
Thanks
...
I have a C++ function returning a std::vector and I want to use it in python, so I'm using the C numpy api:
static PyObject *
py_integrate(PyObject *self, PyObject *args){
...
std::vector<double> integral;
cpp_function(integral); // this change integral
npy_intp size = {integral.size()};
PyObject *out = PyArray_SimpleNewFromData(1, &...
Anyone who has developed file upload progress bar with following:
Ajax
Javascript
HTML
C based CGI
I am stuck at one point.
I am not able to read each updated progress bar value from CGI script.
/*****************CLIENT SIDE CODE*************************/
var intervalID;
var percentage;
var request;
var tempvar=0;
var progress;
fun...
Since C it's not a language I am used to program with, I don't know how to do this.
I have a project folder where I have all the .c and .h files and a conf folder under which there is a config.txt file to read. How can I open that?
FILE* fp = fopen("/conf/config.txt", "r");
if (fp != NULL)
{
//do stuff
}
else
printf("couldn't ...
Hi, I'm having trouble passing a big array to a function in C.
I declare:
int image[height][width][3]={};
where height and width can be as big as 1500. And when I call:
foo((void *)image,height,width);
which is declared as follows:
int *foo(const int *inputImage, int h, int w);
I get segmentation fault error. What's strange is ...
printf("/*something else*/"); /*note that:without using \n in printf*/
I know printf() uses a buffer which prints whatever it contains when, in the line buffer, "\n" is seen by the buffer function. So when we forget to use "\n" in printf(), rarely, line buffer will not be emptied. Therefore, printf() wont do its job. Am I wrong?
...
Any one who knows how to create and update XML file in C?
...
I have the following function from some legacy code that I am maintaining.
long getMaxStart(long start, long count, const myStruct *s1, ...)
{
long i1, maxstart;
myStruct *s2;
va_list marker;
maxstart = start;
/*BUGFIX: 003 */
/*(va_start(marker, count);*/
va_start(marker, s1);
for (i1 = 1; i1 <= count; i...
Just wondering if it's possible to go through a flac, mp3, wav, etc file and edit portions, or the entire file by removing sections based on a specific frequency range?
So for example, I have a recording of a friend reciting a poem with a few percussion instruments in the background. Could I write a C program that goes through the entir...
A friend and I are thinking about creating a simple file system for learning purposes. We're going to write it in C/C++, and try to get it to a mountable state from within linux. We've both been coding or over 16 years (32 combined), so I suppose its just a matter of finding some documentation, and a ton of learning.
My question is, w...
I am coding a breakout clone. I had one version in which I only had one level deep of structures. This version runs at 70 fps.
For more clarity in the code I decided the code should have more abstractions and created more structs. Most of the times I have two two three level deep of structures. This version runs at 30 fps.
Since there ...