How to return string array using Pinvoke
My c/c++ skills are non-existent and there's some custom string array data that needs to be returned from an old C dll fyi - The C/C++ code can be modified as needed ...
My c/c++ skills are non-existent and there's some custom string array data that needs to be returned from an old C dll fyi - The C/C++ code can be modified as needed ...
Hi im working in a code that detects changes in a file (a log file) then its process the changes with the help of fseek and ftell. but if the file get deleted and changed (with logrotate) the program stops but not dies, because it not detect more changes (even if the file is recreated). fseek dont show errors and eiter ftell. how i can...
Hiya, as part of an assessment I have to hand in a code which requires a few non-standard libraries. In order to save submitting the header files and the code I would like to form a 'makefile' with the code and required add-ons sort of 'bundled' together. I have absolutely no idea idea how to go about doing this though and any suggesti...
I have #include<math.h>, and I tried to use pow(x, y) and powf(x, y). but it seems neither of them are under c99 standard. and I use the command gcc -std=c99 test.c -o test to compile. what function there exists I can use? ...
Cscope has eleven search input fields in interactive mode. But when I try to use it in line-oriented output mode and specify Find all symbol assignments: field using -10 switch it does not work. Any ideas? Thanks. ...
GetAdaptersAddresses() will get you addresses in IP_ADAPTER_UNICAST_ADDRESS format, which is defined as: typedef struct _IP_ADAPTER_UNICAST_ADDRESS { union { struct { ULONG Length; DWORD Flags; } ; } ; struct _IP_ADAPTER_UNICAST_ADDRESS *Next; SOCKET_ADDRESS Address; IP_PREFIX_ORIGIN ...
The fopen function returns a pointer to a FILE structure, which should be considered an opaque value, without dealing with its content or meaning. On Windows, the C runtime is a wrapper of the Windows API, and the fopen function relies on the CreateFile function. The CreateFile function return a HANDLE, which is used by other Windows AP...
I have a static variable in source file test_1.c declared as: static char var1 = 0; I need to access the current value of this variable from source file test_2.c. So, I did something like: In test_1.c static char var1 = 0; volatile char var_another = var1; and in test_2.c, I declare the variable var_another as extern and access it...
This is a K&R exercise (1-13)... "Write a program to print a histogram of the length of words in its input. It is easy to draw the histogram with bars horizontal; a vertical orientation is more challenging." The section was about arrays, and to be honest, I'm not sure I fully understood it. Everything up to this point was f...
hi...i'm trying to count the GPU and CPU FLOPS and i've got the source from http://norma.mbg.duth.gr/index.php?id=about:benchmarks:cuda_flops i renamed it to cudaflops.cu and compile it with this makefile ################################################################################ # # Build script for project # ####################...
For example, there is the source: void func1() { func3(); if(qqq) { func2(); } func4( ); } It should be transformed to: void func1() { MYMACRO func3(); MYMACRO if(qqq) { MYMACRO func2(); MYMACRO } MYMACRO func4( ); MYMACRO } I.e. to insert "MYMACRO\n" at the end of each line...
I know all the normal ways of doing this, what I'm looking for is an article I read a long long time ago that showed how to write some crazy helper functions using inline assembly and __naked functions to return a pair of items. I've tried googling for it endlessly, but to no avail, I'm hoping someone else knows the article I'm talking ...
#include <stdio.h> int main(){ int i; char name[10],surname[10],id[12],dpart[20]; printf("******** ID Documentation ***********\n\n\n"); printf("1) What is your Name? \n"); scanf("%s",&name); printf("2) What is your Surname? \n"); scanf("%s",&surname); printf("3) What is your ID Number \n"); sc...
The man page for pthreads mentions: POSIX.1 also requires that threads share a range of other attributes (i.e., these attributes are process-wide rather than per-thread): ... - signal dispositions ... What do "signal dispositions" mean? ...
Hello, i write a little code to simply read a char from the keyboard but the program fails, why? How must i read a char? int main(int argc, char** argv) { char op; do { printf("¿Sigues?"); scanf("%c",&op); }while(op=='s' || op=='S'); return 0; } ...
Possible Duplicate: How do I learn C? Hi friends, I am new to stack overflow and am also a beginner to C programming. Could you please suggest me some good links for C programming (Assuming Programming comes by practice suggest me a link which has good number of programs ) specially the ones related to pointers, call back fun...
Hi, I use the following program to write to a fifo: #include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> using namespace std; int main() { unlink("fifo1"); if (mkfifo("fifo1", 0666) != 0) { ...
Hi all, I've been trying to figure out this problem. I have an assignment to make a basic calculator. To do so i need the instructions in postfix. I have found some code online, which worked but used gets(). I tried replacing the gets... but the program no longer works. Here is the code, i was hoping someone could find the error (usi...
I had a general question earlier and got great responses, but now (even though it's the same exercise) I have a more specific question and thought it deserved it's own Q&A page. Here's my program (not completed, but it compiles and runs ok) : #include <stdio.h> #define IN 1 // inside a word #define OUT 0 // outside a word // #define...
I'm looking for interesting programming puzzles, problems or challenges suitable for a class of chemistry majors learning C as their first programming language. Do you have any recommendations? ...