Search c

218864 results
1

votes
2

answer

Rebinding C-c to C-c

I'm using Viper, and I want to change its C-c and C-g to the original emacs functions. I can rebind C-g with (define-key viper-vi-global-user-map "C-g" 'keyboard-quit), but how can I rebind C-c, since it's a prefix key? Thanks!
konr
11

votes
2

answer

matlab in C C++ and C C++ in matlab [closed]

It seems that are several ways to call matlab in C C++ and to call C C++ in matlab. While I try to list them here, please point it out If I miss something. To call C C++ in matlab, there are also two methods. The first one is to call functions in C shared libraries. The second one is to build C C++...
Tim
2

votes
3

answer

C/C++ Resources To Develop Using MetroWerks C/C++

My friend have real Macintosh IIci, that uses Mac System 7.5.5 under a 68k processor, then I've installed Metrowerks C/C++ version 1 I think, but I'm getting errors even in a simple Hello World program: #include int main(void) { printf("Hello, World!"); return 0; } I'm getting this error: ·· Link...
Nathan Campos
3

votes
2

answer

C# & C++, runtime error when call C++ dll from C#

I have written a C++ wrapper DLL for C# to call. The DLL was tested and worked fine with my C++ test program. now integrated with C#, I got runtime error and crashed. Cannot use debugger to see more details. The C++ side has only one method: #ifdef DLLWRAPPERWIN32_EXPORTS #define DLLWRAPPERWIN32_API...
5YrsLaterDBA
2

votes
3

answer

aquamacs: windows swapping on C-c C-c (python mode)

I apologize if I use the incorrect terminology here, I've only been using emacs for a few months. I just reinstalled Aquamacs on a macbook that I reformatted and am having the oddest problem. I open a .py file, and use C-c ! to open a python shell. So I have (as expected), the .py file in the top wi...
Josh
1

votes
1

answer

Parsing a c/c++/c# file in c#

I have a c file, which has many functions in it. I want to separate out each function and get all of them in a List(lets say, list_code), and also get name of each function in a different List(lets say, fun_code). E.g Lets say, a c file has following code: void main() { //some code here } int count...
Muhammad Nouman
46

votes
4

answer

What's the difference between &C::c and &(C::c)?

Test code in below and I put the output info in comment. I was using gcc 4.8.5 and Centos 7.2. #include #include class C { public: void foo() { printf("%p, %p\n", &C::c, &(C::c)); // output value is 0x4, 0x7ffc2e7f52e8 std::cout
Xianggang ZENG
1

votes
1

answer

How to define emacs keybinding 'C-c C-c'?

I want to bind the 'C-c C-c' to a custom command, don't know how to. I tried (global-set-key (kbd "C-c C-c") 'suspend-emacs), but it seams not work. Any idea will be appreciated. Thanks.
frinkr
1

votes
1

answer

Emacs C-c C-c for python code

I'm new to using emacs as an IDE to python. I have pymode and Ropemacs active. My understanding is that I should be able to highlight a region then use C-c C-c to send it to an interactive terminal. Are there additional packages that I need to accomplish this? The error I'm getting for C-c C-c is...
Mittenchops
4

votes
2

answer

C/C++ to C# converter or emulator

Assume that I have some C code for a portable, non-visual library. The code relies mostly on CRT (there is no QT/DirectX/WinAPI etc. dependencies). Is there a way I could use this code in a C# application? I know about Managed C++ and that's not an acceptable way for me. I thought of a C/C++ to C# c...
Bobrovsky
1

votes
3

answer

static array in c# vs c/c++

this code is correct in C# int x = int.Parse(Console.ReadLine()); int[] t = new int[x]; but in c/c++ in wrong int n; scanf("%d",&n); int a[n]; how in c# static array allocate in runtime (or in c# array is dynamic?)
maysam
4

votes
4

answer

C and C++ linkage with extern “C”

I have a C++ function defined in a .h file as follows and implemented in a .cpp file: extern "C" void func(bool first, float min, float* state[6], float* err[6][6]) { //uses vectors and classes and other C++ constructs } How can I call func in a C file? How do I set up my file architecture / makefil...
2

votes
3

answer

C# Code Analyzer for C, C#, C++ and Java. [closed]

Please are there any tools available that will parse my source code to enumerate all class and function dependency for my project (C, C#, C++ or Java) and save it in doc, XML or any other format? Thank you.
ChinCo
7

votes
3

answer

Difference between scanf(“%c”, &c) and scanf(“ %c”, &c) [duplicate]

This question already has an answer here: Why does a space in my scanf statement make a difference? [duplicate] 3 answers Consider the following C code snippet: #include int main() { int a; char c; scanf("%d",&a); scanf("%c",&c); printf("int=%d\n",a); printf("char=%c\n",c); } I'm able to input onl...
passmaster10
-6

votes
2

answer

C Style Strings Difference : C/C++ [duplicate]

This question already has an answer here: What is the difference between char a[] = ?string?; and char *p = ?string?;? 8 answers What is the difference between C Style Strings char str[10]="Hello"; char str[]="Hello"; char* str= "Hello"; 1) I believe that char str[10]="Hello" is automatic variable...
Gaurav K
5

votes
9

answer

main() in C, C++, Java, C#

Is main() (or Main()) in C, C++, Java or C#, a user-defined function or a built-in function?
stackoverflow.com
2

votes
9

answer

Learn C# to transition to C/C++?

Alright, so I just took an introductory class into Computer Science and the school's language choice was Java (I have basic knowledge of concepts like polymorphism, encapsulation, etc..). I want to learn C++ then C (I hear that one should learn C++ first then go to C), and was wondering if C# is a n...
Karan Bhamra
14

votes
3

answer

Managed C++ (C++/CLI) vs C#/VB.NET

I have worked extensively with C#, however, I am starting a project where our client wishes all code to be written in C++ rather than C#. This project will be a mix between managed (.NET 4.0) and native C++. Being that I have always preferred C# to C++ for my .NET needs, I am wondering if there are...
Bender the Greatest
6

votes
3

answer

Wrapping Objective C in Objective c++/c++

I've got a c++ app written using Boost/WXWidgets, targeting Windows and Mac OSX. However, I've got one issue that I can't solve using these libraries. My solution requires me to wrap an Objective C class so that I can call it from one of my c++ modules. My research so far tells me that I need to...
Tim Burgess
13

votes
7

answer

Introduction to C# for C/C++ users

I have 6+ years of C/C++ experience. Tomorrow starts a university assignment where I will have to use C#. Therefore I would like to have a list of links/resources which you think important or an extensive tutorial - in short everything you think worthy. Coding style, best practices, ... (I don't kno...
Ronny Brendel
3

votes
3

answer

C / C++ / C#: Howto do “mount -a”

Question: In C/C++/C#. (I need it for C#, but C and C++ is also fine). How can I do a mount -a on Linux. I mean programmatically, without starting a process like system("mount -a"); Edit: Note the "-a". My question is not actually about how to mount A mountpoint. It's about how to mount ALL mountp...
Stefan Steiger
4

votes
3

answer

Convert a C printf(%c) to C#

I'm trying to convert this C printf to C# printf("%c%c",(x>>8)&0xff,x&0xff); I've tried something like this: int x = 65535; char[] chars = new char[2]; chars[0] = (char)(x >> 8 & 0xFF); chars[1] = (char)(x & 0xFF); But I'm getting different results. I need to write the result to a file so I'm doing...
Rias
0

votes
1

answer

C/C++ equivalent to C# params [duplicate]

This question already has an answer here: Variable number of arguments in C++? 15 answers Is there a C/C++ equivalent to C# params? This C#: public static void UseParams(params int[] list) { for (int i = 0; i < list.Length; i++) { Console.Write(list[i] + " "); } Console.WriteLine(); } UseParams(1,...
Nicky
2

votes
4

answer

Objective-C And MetroWerks C/C++ IDE

I'm learning Objective-C and my friend have a real Macintosh IIci, that uses a Mac System 7(specifically 7.5.5 with a 68k processor) and I've installed Metrowerks C/C++ IDE(I think it's the version 1, but I don't know), but i didn't tested it, then i want to know one thing: It's possible to develop...
Nathan Campos
5

votes
3

answer

C/C++/C#/VB based Lexical Analyzers

During the Compiler Design Lab hours, I'm using JLex as the Lexical Analyzer Generator, which produces a Java program from a lexical specification. I'd like to know if there are other tools which can help me in the same by generating C/C++/C# or VB programs instead of a Java program, and can run in...
Arjun Vasudevan
2

votes
0

answer

Calling c/c++ code from C# .net

I have got a DLL in native code, and i need to call a specific function from that DLL from c# code. Signature of the function is this: long Validate(char *p). please help me on this. We are using ZP4 for Address verification. From Semaphore tutorial they have mentioned that for checking the soft...
Naji Aboo
3

votes
3

answer

Calling C++ DLL from C++ and C#

I have a C++ application that I have to convert to a DLL. I have all the source. my function is extern "C" __declspec(dllexport) int mymain(int i, std::wstring myArgs) I need to be able to pass in the arguments from a c++ or c# wrapper. I am able to call this from a c++ console application withou...
Jeff
5

votes
2

answer

C/C++ Code Compiler in C#

In C#, I am able to compile VB and C# Code, using the code below, but I have no way of compiling C/C++ code. Is there any way of doing this? C# Compiler: public void Compile(string ToCompile) { string Result = null; string errors = null; Microsoft.CSharp.CSharpCodeProvider codeProvider = new Microso...
Joe
4

votes
5

answer

C/C++ vs Objective-C Arrays

So, I'm making an iPhone app in Objective-C and need to use an array. Usually in Objective-C I'd use NSArray or NSMutableArray, but I'm starting to wonder if that's the best idea when simply using a basic array. Memory- and efficiency-wise, does it make more sense to use a regular C array or an Obje...
Alexis King
2

votes
4

answer

Converting C (not C++) to C#

I have some old C 32 Bit DLLs that are using Oracle's Pro C precompiler library (proc.exe) to expose a hundred or so sproc/func calls to an even older VB6 GUI which references these functions through explicit Declare statements like so: Declare Function ConnectToDB Lib "C:\windows\system32\EXTRACT32...
MaSuGaNa
3

votes
1

answer

Objective-C++ Calling C or C++ function

as most of the other Objective-C questions posted here, I too am a newbie to ObjC. I am writing an iOS application based on our existing product that is written in C# and C++. I have written an entire library in C++, that I was hoping to use directly in the iOS device, by simply providing a few #i...
LarryF
1

votes
1

answer

Modelling C/C++ unions in C#

I have the task of modelling the following struct in C#: typedef struct _SHELLEXECUTEINFO { DWORD cbSize; ULONG fMask; HWND hwnd; LPCTSTR lpVerb; LPCTSTR lpFile; LPCTSTR lpParameters; LPCTSTR lpDirectory; int nShow; HINSTANCE hInstApp; LPVOID lpIDList; LPCTSTR lpClass...
series0ne
7

votes
4

answer

C-string definition in C / C++

What really means by word "C-string" in C / C++? Pointer to char? Array of characters? Or maybe const-pointer / const array of characters?
FrozenHeart
12

votes
3

answer

C/C++ Interoperability Naming Conventions with C#

Consider the following Win32 API struct: typedef struct _SECURITY_ATTRIBUTES { DWORD nLength; LPVOID lpSecurityDescriptor; BOOL bInheritHandle; } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; When porting this object to C#, should I follow the name naming conventions used he...
series0ne
4

votes
9

answer

C# and C++ in relation to C

I've never programmed using C or whatever but I use this site a lot so as you can imagine I run into them quite a lot. And due to the fact I don't really understand the languages this is a question Google can't really answer. So in simple terms what are the differences between each of these language...
Ben Shelock
2

votes
2

answer

C/C++ Memory Problem?

Programming for my Arduino (in some kind of mix of C/C++), I noticed something weird. Everytime I communicate through the serial port, I keep an eye on the SRAM usage. Normally, it ranges between 300~400 bytes. However, after adding a new routine (see below), I noticed it always jumped from 300~400...
3

votes
5

answer

C to C++ converter

Some of the C code do not compile with C++ compiler if compiled as C++ files, due to the stricter type safety of C++. Is there any tool which takes the C code and generates a valid C++ code out of it. In other words, it adds to the C code what is required to make that code compile with a C++ compile...
MetallicPriest
4

votes
1

answer

C/C++ Preprocessor - 'Charify'

Is there a way of 'charify'ing something using the C/C++ preprocessor? You can 'stringify' by doing: #define STRINGIFY(x) #x So, would there be a way of 'charify'ing using the same principles?
Joseph
2

votes
1

answer

C/C++ PLSA libraries

I need a library that implements PLSA algorithm. Possibly I'm looking for a C/C++ implementation, but other language will be good anyway. Can someone help me?
Aslan986
6

votes
7

answer

auto c/c++

Has anyone ever seen the storage class auto explicitly in use in c/c++? If so, in what situation?
c0m4