I am looking at a SQLite database owned by a third party process. It appears locked and has a *-journal file. What I don't know, is if the lock is shared or exclusive.
I am hoping to read from the database even though it is currently locked by that other process. I will only ever read from the database.
Currently I fail at this. I get ...
if you have a struct consisting of complex data items. Can you assign one instance to another.
struct Test t1;
struct Test t2;
t2=t1;
i have seen that it works for simple structures, does it work for Complex structures?. How does the compiler know how to copy data items depending on their type, eg differentiating between an int and st...
I know I can profile my code with gprof and kprof on Linux. Is there a comparable alternative to these applications on Windows?
...
I'm used to gprof for profiling my C code, but I want to start using a GUI-based Windows application such as Luke Stackwalker. gprof works perfectly fine on my binary, but Luke Stackwalker has some issues:
Launching executable C:\lshare\POT03\Eclipse\Debug\POTaak3.exe.
SymInit: Symbol-SearchPath: ';.;C:\Program Files\Luke Stackwalker;C:...
What all aspects should be considered for conducting a code review workshop?
It should be generic and 'C' Language based. Both experienced and junior programmers will form the audience.
If a test or hands-on should be included, what can be the format for the same?
...
Are there functions for performing atomic operations (like increment / decrement of an integer) etc supported by C Run time library or any other utility libraries?
If yes, what all operations can be made atomic using such functions?
Will it be more beneficial to use such functions than the normal synchronization primitives like mutex ...
Hi, when I try to compile my code below I get the following errors:
error C2440: '>=' : cannot convert from 'double *' to 'double'
error C2440: '>=' : cannot convert from 'double *' to 'double'
I believe I'm dereferencing everything correctly
#define TRUE 1
#define FALSE 0;
#include <stdio.h>
typedef struct Con{
double samTime[2]...
If I have a float value that the user sets, like 1.82, how can I find the next highest .05 value (1.85)?
Is there a simple way or does this take a lot of math? I'm trying to use floor and ceiling to come up with the distance from the float to the next highest and lowest integers, but keep getting stuck, because I'm not sure what to do ...
Today I appeared for an interview, and the question was writing my own "char * ftoa(float num) " in C, C++ and Java.
Yes, I know float numbers follow IEEE standard while allocating their memory, but I don't know float to char conversion by using Mantissa and Exponent in C.
I don't have any idea to solve the above problem in C++ and J...
Is there a one-liner that will free the memory that is being taken by all pointers you created using mallocs? Or can this only be done manually by freeing every pointer separately?
...
Can somebody please show me in C-style pseudocode how to write a function (represent the points however you like) that returns true if 4-points (args to the function) form a rectangle, and false otherwise?
I came up with a solution that first tries to find 2 distinct pairs of points with equal x-value, then does this for the y-axis. Bu...
#include<stdio.h>
#include<unistd.h>
int main()
{
int i = 1;
if(!fork())
{
while(i)
{
printf("Enter i");
scanf("%d",&i);
fflush(stdin);
fflush(stdout);
}
}
...
I'm curious about how some built in functions are implemented,but it's very time consuming to look it up directly in the source,is there a tool that can automate this?
EDIT
Or is there a tool that can debug into the c code that's actually executed?
...
Nearly every (relatively) new book about c programming I've seen doesn't seem to adhere to the C99 standard, or they cover it in an extra chapter. Comming from a Java background, the C99 standard made the migration (well, still migrating ^^) much easier for me, and this probably applies to other languages, too.
It seems like C99 hasn't ...
For a project at university I need to extend an existing C application, which shall in the end run on a wide variety of commercial and non-commercial unix systems (FreeBSD, Solaris, AIX, etc.).
Which things do I have to consider when I want to write a C program which is most portable?
...
If Python was so fast as C, the latter would be present in python apps/libraries?
Example: if Python was fast as C would PIL be written completely in Python?
...
Hi,
is it possible to check if a file in a specific directory is accessed by a process X and get the process id (in c++ or better c#) ?
I think there must be a moment, when the file is accessed by a process before it is opened by it. (for example anti-virus tools are using this too)
Example:
I double-click a txt file
Before notepad i...
If I declare a pointer to a struct in .h for example:
my_struct_t *ptr;
... and then I check if(ptr==NULL) in the code, without actually setting ptr to NULL or allocating memory for it, can I do that check to see if its equal to NULL?
essentially what I'm asking is, by having ptr in the .h, does it get set to NULL automatically, or d...
Given:
#define f(x, y) (x+y)
#define g(x, y) (x*y)
#define A 1, 2
#define B 2, 3
int main() {
int a = f(A);
int b = g(A);
int c = f(B);
int d = g(B);
}
which does not work,
how can I make it work? The basic idea is that I have one list of arguments that I want to pass to two different macros, without repeating the list of lo...
Is there a way to do check for numerical equality in macros?
I want to do somethign like
#define choice 3
#if choice == 3
....
#endif
#if choice == 4
...
#endif
Does C macros have support for thigns like this?
...