Programmatically assign new letter to existing drive with C++
I want to change a drive letter. For example, I can use diskpart to assign a new letter to a drive (a USB disk or a new hard disk). How can I implement it in C/C++? ...
I want to change a drive letter. For example, I can use diskpart to assign a new letter to a drive (a USB disk or a new hard disk). How can I implement it in C/C++? ...
Which open-source projects do you feel C/C++ Windows developers should be aware of? Boost Libraries: generic library (smart pointers, command line parsing, threads, formatting, etc) Postgresql: full-feature SQL database. MediaInfo: provides information about audio/video files. ...
I want to take a substring of the string buffer by doing something like the below. I don't know if it's possible (I've been coding in C for all of about 6 hrs now, but feel free to be as technical as you like, I think I can handle it (though I may be wrong)) Edit: I want to take a substring of buffer from the beginning of buffer to the...
hi For comparing strings in UNICODE versions is it advisable to use strcmp or _tcscmp? Thanks in advance ...
How do I call execlp() with a variable number of arguments for different processes? ...
int startingPoint[2]={i,j}; I got this after reading an online code.Is this correct? Means if values of i and j can be changed at runtime before this statement, will this initialize the array with the correct values? Please explain. ...
What really are the valid signatures for main function in C? I know: int main(int argc, char *argv[]) Are there other valid ones? ...
Hi everybody. I'm still struggling to get my sample code working on a 64 bit machine. My previous problem was solved because of missing/outdated headers/libraries. I compile this code as follow: gcc -Wall -g -o server server.c and gcc -Wall -g -o client client.c I run them on 2 linux machines(both 32bit) and it works fine. When I recom...
What happens when assign a value to an array if the subscript exceeds the size of the array in C? In other languages it throws an exception, does C also throw an exception? For some reason i dont get any errors ...
Hello, I need to implement a simple over-the-network interaction in C++ and I've been wondering whether there are libraries that do that already. My protocol basically sends messages and receives responses. Each message is just a set of 3-4 values of basic data types. I would like to find a library (or libraries) that can do one or more...
I have seen some code in which the arguments passed to the function by value was being modified or assigned a new value and was being used like a local variable. Is it a good thing to do? Are there any pitfalls of doing this or is it Ok to code like this? ...
I have more than one doubt so please bear with me. Can someone tell me why this code fails? #include<stdio.h> void main(int argc,char **argv) /*assume program called with arguments aaa bbb ccc*/ { char **list={"aaa","bbb","ccc"}; printf("%s",argv[1]);/*prints aaa*/ printf("%s",list[1]); /*fails*/ } I assumed it had somet...
I understand most of the micro-optimizations out there but are they really useful? Exempli gratia: does doing ++i instead of i++, or while(1) or for(;;) really result in performance improvements (either in memory fingerprint or CPU cycles)? So the question is, what micro-optimizations can be done in C? Are they really useful? ...
I already know how to detect VMWare and VirtualPC, but I want to know how to do this in Kernel Virtual Machine. I would like the code to be in C or C++. ...
How can I change the MySQL query delimiter using the C API? I tried sending DELIMITER | as a query, complained about ..the right syntax to use near 'delimiter' at line 1.. Tried DELIMITER |; too, no luck. Tried DELIMITER |; SELECT 1|, no luck. :( The reason I ask is that I need to create a trigger through the C API such as the followin...
i know how to this in .net i want to know how in pure c and not c++ thanks. ...
I am involved in a contest, and in one event we have debugging questions. I have to design some really good debugging problems in C and C++. How can I create some good problems on debugging? What aspects should I consider while designing the problems? ...
So I'm working with this huge repository of code and have realized that one of the structs lack an important field. I looked at the code (which uses the struct) as closely as I could and concluded that adding an extra field isn't going to break it. Any ideas on where I could've screwed up? Also: design advice is welcome - what's the be...
Are there any tips which we should follow for good design when we are considering the 'C' as the implementation language. I want tips which should be considered because we are using 'C' as the implementation language and not related to the functionality. ...
I'm quite happy that, in C, things like this are bad code: (var_a == var_b) ? TRUE : FALSE However, what's the best way of dealing with this: /* Header stuff */ #define INTERESTING_FLAG 0x80000000 typedef short int BOOL; void func(BOOL); /* Code */ int main(int argc, char *argv[]) { unsigned long int flags = 0x00000000; ...