Hello,
I have an issue. I have defined in C file, read-line.c, a function print, like this:
void history_print(void)
{
/* some stuff */
}
In a C++ file, command.cc, I have the following:
extern "C" void history_print(void);
and then I simply call history_print().
#Use GNU compiler
cc = gcc -g
CC = g++ -g
all: shell
tty-r...
I could see from MSDN documentations that a new windows service will be stored in the registry HKLM\System\CurrentControlSet\Services
However the services registry key does not hold a value for the "service running status"
Can anyone let me know where the service running status will be stored?
...
Is there a limit on the number of arguments that we pass to main() in C? As you all know, it is defined as int main(int argc, char *argv[]).
When I call the program, I can pass arguments like so:
$ prog.exe arg1 arg2 arg3.....argn
Is there an upper bound in the number of argument that we may supply to main() in this way?
...
Can we declare a variable in both the inner and the outer block of my program?Why it is called a bad practice if programatically it doesn't create any problem..
...
main()
{
int x=5,y=3;
x=x+~y+1;
printf("%d",x);
}
What would the output be?
...
I have a third party encryption library, which may create a MessageBox if key creation fails. The failure can be caused by bad random number generation or other rarities, and in most cases, trying again will result in success. My code will attempt key creation up to three times before deciding it failed.
Now, the issue is that the progr...
I have following function defined in one dll:
__declspec( dllexport ) int __stdcall
mjscall(char *cmd, DWORD wtime, char *stdoutfile, char *stderrfile )
I need to write one process to call the above function.
I am doing it first time,I do not have much idea.
I have written the following code
#include <windows.h>
#include <windows.h>
...
#include <iostream>
using namespace std;
int main()
{
char buffer[8];
int field=534;
memcpy(buffer,&field,sizeof(field));
cout<<buffer<<endl;
return 0;
}
This returns an empty buffer. Why?
Basically looking for an alternative to sprintf to convert int to char buffer.
Itoa is not available.
Thoughts? Bet...
Suppose I have a file path as C:\Sample\example.txt.
how can full path of the file be retrieved (the file can be in any directory) just by giving the filename i.e., example.txt in C ?
...
Why do some people write methods in header file ?
And what's the difference between writing a method in a procedure file and a header file?
Here's the code :
Work.h
#include <time.h>
void DoWork(int n)
{
clock_t t = clock() + n * CLOCKS_PER_SEC / 1000;
while(clock() < t);
}
Program.c
#include <stdio.h>
#include "work.h"
...
Hi,
I have an ema function in fortran 77. How can I call to fortran function from C. I know that in fortran 2003 there is a iso_c_bindings but I need some solution for old 77 standard.
subroutine ema(inarray,leninarray,n,outarray,lenoutarray)
integer leninarray, lenoutarray, n, i
double precision inarray(leninarray), outarray(lenoutar...
Hello
gcc 4.4.3 c89
I have a event loop that runs in a separate thread.
My design is like this below, just sample code to help explain.
I need to somehow wait for the initialization to complete before I can make a call to the get_device_params.
I did put a usleep for 3 seconds just before the call to the get_device_params, but I do...
Hi!
I want to create a small application which gets my motherboards type. How can i do this using C?
Thanks, kampi
...
How to add daemon stop, start and report function to this daemon code?
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h>
int main(void) {
/* Our process ID and Session ID */
pid_t pid, sid...
Hi,
How can i make that the console, with the output, will not disapear after the program ends in VS 2010 express C++?
i write in c and not in c++, soo i need a function and include path to library.
Thanks
...
My friend is learning Norwegian and i want to make a global hot key program which sends keys such as
æ
ø
å
My problem is that keybd_event function wont allow me to send those keys, i seem to be restricted to the virtual key codes is there another function that i could use or some trick to sending them?
...
I have written a program that prints a table. I have not included the return syntax in the main function, but still whenever I type echo $? it displays 12.
My source code :
#include <stdio.h>
int main(void)
{
int ans,i,n;
printf("enter the no. : ");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
ans = n*i;
...
This is related to calling C functions (made into dynamic libraries) from SAS. There are 4 files. the first 2 (1 c-file and 1 sas-file) are a positive control using doubles. The remaining files are the problematic.
C-FILE-1
#ifdef BUILD_DLL
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __declspec(dllimport)
#endif...
I don't understand why
struct e{
void * a;
void * b[];
}
has sizeof(e) == 4 while
struct f{
void * a;
void * b;
}
has sizeof(f) == 8.
...
Hi,
Does a good manual exist for the standard C libraries? Like man for Linux or Java API.
Edit
I am working in Visual Studio 2010 Express.
I prefer something like Java API to see all libraries and not like man that show function that I know already exists without giving me the all list of function, and also man not exist in Windows...