Click here to Skip to main content
15,889,335 members
Everything / Programming Languages / C

C

C

Great Reads

by Martin Mitáš
How to support scrolling within your controls.
by Espen Harlinn
Choosing the right synchronization mechanisms when working with threads, thread-pools, and I/O Completion ports to create high performance asynchronous servers in C++
by Andy Allinger
Add features to k-means for missing data, mixed data, and choosing the number of clusters
by Jeffrey Walton
Perform authenticated encryption with Crypto++.

Latest Articles

by Chris Boss
BASIC: A powerful language often underestimated and undervalued
by ColleagueRiley
A multi-platform single-header very simple-to-use framework library for creating GUI Libraries or simple GUI programs.
by FPGANinja
A walkthrough and source code for designing a stream interface in Vitis HLS
by Alexey Shtykov
The thing that could generate pseudo random numbers faster than standard library does

All Articles

Sort by Updated

C 

7 Jan 2010 by #realJSOP
You have to ask more precise questions.Do want the size of an ulong type, or the maximum ulong value?
29 Jan 2010 by #realJSOP
Fer christ's sake, use google! This is for QUICK answers.
29 Jan 2010 by #realJSOP
It might be, but I bet that you'd probably have to write a driver to do it.You need a lot of programmer foo to write drivers.
31 Jan 2010 by #realJSOP
Yeah - it's called a windows service.
2 Feb 2010 by #realJSOP
There's no earthly way you can determine why the connection dropped. You can only determine that it did in fact drop.
6 Feb 2010 by #realJSOP
That sure is a pretty block of code, but without an explanation of what you want help with, it's kinda pointless.
5 Feb 2010 by #realJSOP
What's your question? Have you actually tried to run this code?
8 Feb 2010 by #realJSOP
First, it looks like C++ to me. Second, learn how to use tags. Your code is supposed to be properly formatted when you post it here.
10 Feb 2010 by #realJSOP
Crap in one hand, and want in another, and tell us which one fills up faster...
15 Feb 2010 by #realJSOP
Based on your response that it is a C++ DLL (assuming an unmanaged DLL at this point), you have to use System.Runtime.InteropServices to access the functionality of the DLL.If you don't have the source code to the DLL, you can find out what methods are exported by using a utility called...
7 Mar 2010 by #realJSOP
You can use a (free) program called Depends to examine the exposed API of the dll you're trying to use. Use google to find the download.
14 Mar 2010 by #realJSOP
I would start with: int main(){}Didn't your instructor provide you with the knowledge you need to do something like this?
25 Apr 2010 by #realJSOP
And while you're waiting for someone to do your work for you, I would like to offer you a FROM JSOP: And while he's waiting, he'd like a double sweet latte with extra whipped cream and a light dusting of nutmeg. We are also offering free scones and a clue with every luxury coffee beverage.
26 Apr 2010 by #realJSOP
Well, what are you trying to accomplish? In the code you've posted, as long as pwnd isn't null, you should be good to go. What else are you concerned about?
3 May 2010 by #realJSOP
So accept the answer (there's a button there for it).
12 May 2010 by #realJSOP
First, this is called "Quick Answers", not "Teach Me Everything There is To Know About This or That".Second, you not likely find many people here that can discuss this topic with any kind of authority since this is primarily a Windows developer site.Third, we don't do people's homework...
23 May 2010 by #realJSOP
Google the phrase "WMI C++". I'm sure you'll come up with a bunch of hits.
15 Jun 2010 by #realJSOP
It's easy to do. Really. Just be a programmer and write it.
15 Jun 2010 by #realJSOP
Here - try this.public string ReadTextFile(string filename) { StreamReader re = File.OpenText(filename); string result = ""; string input = ""; try { while ((input = re.ReadLine()) != null) { ...
26 Jun 2010 by #realJSOP
We don't do people's homework assignments for them. However, if you have a problem, show us the code you're having trouble with, and you just might get answers.
1 Jul 2010 by #realJSOP
You're probably missing the parenthesis in your constructor definition.You probably have this :MyClass::MyClass{}instead of this :MyClass::MyClass(){}
1 Jul 2010 by #realJSOP
Quick Answers is for asking programming questions about code you're hacving a problem with, and is NOT a forum for diuscussion about projects you'd like to build. There's probably an appropriate forum on this site for this kind of thing, but Quick Answers is NOT it.
8 Jul 2010 by #realJSOP
double sample = 1.234double fractional = sample - Math.Floor(sample);
11 Jul 2010 by #realJSOP
Maybe you shouldn't worry about it. Copy protection won't work because if your application is deemed to be important enough, someone somewhere will figure out a way to deactivate anything you might put in the code. However, if you really think your application is worthy of stealing, you...
21 Aug 2010 by #realJSOP
Did you even have a twinkle of a thought of using google to find sample code?I googled "linq to xml sample", and found this site among over 1.2 MILLION hits.http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx[^]
14 Sep 2010 by #realJSOP
Well, try it and see what happens...
16 Sep 2010 by #realJSOP
Wow - TurboVision. I haven't heard that name in a LONG time (1989 to be exact).
27 Sep 2010 by #realJSOP
Google "math with complex numbers".
27 Sep 2010 by #realJSOP
Try here[^].
6 Oct 2010 by #realJSOP
Create a new solution in Visual Studio, and start coding.
14 Oct 2010 by #realJSOP
Because float types are notoriously inaccurate.Using double would be better until you started doing math with it, and then, all bets are off.If you want the best possible accuracy, use a decimal type.
18 Oct 2010 by #realJSOP
Homework, right? I won't give you code, but I will give you a direction.You want to look into using the sprintf function.
20 Oct 2010 by #realJSOP
You want to look at the sprintf function. That's as much help as I'm willing to give. If you're learning C, you simply MUST learn the contents of the various libraries. That's the ONLY way you're going to be successful with the language.
26 Oct 2010 by #realJSOP
Take a class. Buy books. Learn how to type "google.com" BEFORE learning to type "codeproject.com".
15 Nov 2010 by #realJSOP
Writing to the registry requires admin privileges. You probably have to install it from the admin account on the machine.
19 Nov 2010 by #realJSOP
Have you tried google? I think it's available everywhere but China.
29 Nov 2010 by #realJSOP
The object of your homework assignment is prettyy much a 50/50 split between analyzing the problem and implementing a solution. What good is it going to do you if we were to give you a desgn? Come up with your own solution and uimplement it. When you have a specific problem in the code...
14 Dec 2010 by #realJSOP
You can't (shouldn't). A constant is called a constant because it's value is - well - constant.EDIT ==================Why did you vote this a 1? It's damn well correct. A constant cannot be changed at runtime, dynamically or otherwise. That's why it's called a "constant".If you need...
26 Dec 2010 by #realJSOP
There are a few things you can do:0) Convert your database to be completely xml-based. You can then free yourself from SQL server, and your application becomes the control for the data. This is probably not what you - personally - want to do because it involves writing more code, which...
7 Jan 2011 by #realJSOP
It's been a number of years since I had to do any C++ or COM work, but try this:IVdsDisk* pVdsDisk = NULL;HRESULT hResult = ppObjUnk->QueryInterface(IID_IVdsDisk, (void**)&pVdsDisk); if (hresult == SUCCESS){ VDS_DISK_PROP diskProp; hResult =...
10 Jan 2011 by #realJSOP
You could try google. I found this CodeProject article with the search phrase, "C++ get cpu load":Get CPU Usage with GetSystemTimes[^]
11 Jan 2011 by #realJSOP
If you're a beginner, this is probably a homework assignment. Given that assumption, it would probably also be safe to assuem that your instructor gave you everything you need (in terms of instruction) to come up with the code you need to complete the assignment.Nobody here is going to write...
12 Jan 2011 by #realJSOP
Well, that 12-byte region is marked as "reserved", which mesans a future OS could use it at any time. You may also experience certain Anti-virus apps seeing data in that region as a possible virus attack.
12 Jan 2011 by #realJSOP
Does "don't have time" actually mean "waited until it was too late"?The point of the assignment isn't to copy someone else's work - it's to do the work yourself.
14 Jan 2011 by #realJSOP
You could look into this:MSG msg;while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg);}
16 Jan 2011 by #realJSOP
I think the only way you could pull this off is if the application in question could be constrained in a window that your own application creates. Since X-Plane is a game, and since most game companies would never even consider running their game in a window that wasn't borderless and full...
18 Jan 2011 by #realJSOP
Did you even think about using google? Search for "partition polygon into monotone chains" and you'll get 22,000 results. Surely, one of those has to be "readable".
20 Jan 2011 by #realJSOP
Linux isn't Unix. They're close, but there will be differences. Try this web site:Linux Socket programming tutorials[^]
24 Jan 2011 by #realJSOP
It's called the System Managment Console. Right click My Computer, select "Manage" from the context menu, and when the form comes up, look atr the bottom, and there's an entry in the tree labeled "Windows Services". Click that, and you'll see all of the services.
29 Jan 2011 by #realJSOP
We don't do homework for people. It's not that we feel that we're above it, but rather that you are given these assignments for YOU to learn how to do something. Many times, the process is more important than the outcome where a homework assignment is concerned. If we do it for you, YOU won't...
4 Feb 2011 by #realJSOP
Go to your project properties C/C++ | Code Generation | Runtime Library | Multi-threaded Debug DLL (/MDd), or Multi-threaded DLL (/MD) for the release config.
6 Feb 2011 by #realJSOP
Look for a 3rd party tool to do it. Here's one I found using google:CryptKey[^]Why did you ask your question a 2nd time?
6 Feb 2011 by #realJSOP
If you know the pattern, it would be a simple matter to write code to fill in missing/following numbers. If your pattern has an actual name, you can probably find a formula for it on the internet somewhere. For instance, the Fibonacci pattern is described...
8 Feb 2011 by #realJSOP
We don't do homework for people. It's not that we feel like we're superior or anything, it's that you won't learn anything if we do the work for you. Make an effort to do the work yourself, and if you have a specific problem, come back and ask a question about that problem.
9 Feb 2011 by #realJSOP
To what end? That's not going to guarantee they're all in the correct place, so making sure there are an equal number of each is fairly pointless.After replying, I realized that this is a homework assignment.
10 Feb 2011 by #realJSOP
If it requires admin access, the UAC will take care of it by prompting you for an admin password. Of course, I'm assuming that you're using Win7 or Vista.
11 Feb 2011 by #realJSOP
Try this link:http://msdn.microsoft.com/en-us/library/ms682425.aspx[^]I think you want CreateProcessAsUser() or CreateProcessWithLogonW().
16 Feb 2011 by #realJSOP
FFS, what didn't you understand about "use google"?If you google "c encryption example", you'll get almost 12 MILLION results back. Here's one of them:http://www.codealias.info/technotes/des_encryption_using_openssl_a_simple_example[^]If you're going to be a programmer, you'd better...
17 Feb 2011 by #realJSOP
We don't do homework for people. It's not because we feel superior, but because it's important that you learn how to analyze a problem, and design/implement a solution. If you can't do that, you'll never be a successful programmer.
9 Mar 2011 by #realJSOP
Code looks fine to me. Where are you getting the error message, and what error message is it?
10 Mar 2011 by #realJSOP
If you're here asking for "codes" to do something, I seriously doubt you are aware of just how involved such a project would be, much less have the programming foo to maintain/support such software.Beyond all that, try googling for the info you need (though I seriously doubt you'll find much...
14 Mar 2011 by #realJSOP
0) What is a "Mis Tech"?1) Download Visual Studio 2010 Express (it's free).2) This is the hard part - decide what platform/architecture/language you want to code for. Platforms are Web or DesktopIf you picked Web, you're looking at asp.net, which includes html, javascript, css...
23 Mar 2011 by #realJSOP
C is not not capable of having classes. Period. If you want classes, you have to use C++.
13 Apr 2011 by #realJSOP
Looks to me like it's defining a field offset based on the type of value that's represented by the specified field name.
15 Apr 2011 by #realJSOP
You should really try google. I did, and got back almost 58,000 results:search phrase = "sjf algorithm"[^]
18 Apr 2011 by #realJSOP
Show us the C# code you use (it shouldn't be a lot of code).
20 Apr 2011 by #realJSOP
I think you want this instead (I may be wrong, my C++ foo has long gone unused):char* str[100];for (int i = 0; i > str[i];}
21 Apr 2011 by #realJSOP
I believe that the socket object knows the ip it's connected to. Of course, you gave almost no information, so I'm only guessing that your using the CSocket class.
22 Apr 2011 by #realJSOP
Can't use google? I googled "opengl c", and got back 12.8 MILLION results back. The third link was to opengl.org itself and is a page of c example applications.Here's a link to the returned results:"opengl c"[^]
13 May 2011 by #realJSOP
It's unclear because we don't know what the algorithm is trying to achieve.
13 Jun 2011 by #realJSOP
If you're expected to keep the indexes lined up with the other two arrays, you're in a world of hurt.The first thing I'd do is create an object to hold one element from each array (at the same index, of course). Next, I'd put thos objects into a generic list. Next, I'd use this tip/trick to...
17 Jun 2011 by #realJSOP
We don't do people's homework for them. It's not because we feel superior, but because YOU won't learn anything if we do your homework for you. If you put some effort into doing this yourself, and have a SPECIFIC PROBLEM, come back and ask about THAT PROBLEM, and you'll likely get more help...
17 Jun 2011 by #realJSOP
cmd.CommandTex...
1 Jul 2011 by #realJSOP
Look at solution #2 for the answer:how to use stdout for data share between two processes[^]Even better, why don't you guys collaborate because you're working on the same freakin' thing.
3 Jul 2011 by #realJSOP
If you're participating in "major projects", you shouldn't need a book at this point in your programming career. Beyond that, no single book is going to be the "best book". I think that if you have good fundamental programming practices, you should be able to rely on google for your...
3 Jul 2011 by #realJSOP
We don't do homework for people - not because we feel like we're elite or too important, but because YOU won't learn anything if we do it for you. If you try to do it and have a problem with a particular part of the code, come back here and ask a question about THAT particular part of the code -...
8 Jul 2011 by #realJSOP
We know what self-modifying code is, and it's not possible in C. 0) Each compiler generates a slightly different binary representation of the source code (even between versions of the same compiler). 1) You would have to disassemble the code - in memory - and then modify the assembly...
8 Jul 2011 by #realJSOP
I don't see dest declared anywhere...
8 Jul 2011 by #realJSOP
This should explain it[^]
25 Jul 2011 by #realJSOP
Why don't you just do the work assigned to you? If you're good at what you do, people will notice.EDIT ==============I think your really need to read this article:Being a Programmer[^]The best way you can impress your superiors is to put 120% into the work to which you've been...
25 Jul 2011 by #realJSOP
You can't "control the kernel" of an OS. If you could, nobody would be using it. The topic you need to master is "common sense".
28 Jul 2011 by #realJSOP
Using an obfuscator tool is the only way. Be aware that obfuscating doesn't make it "impossible", but it can make it significantly more difficult to do in a timely manner. One tool not to bother with is the one that comes with Visual Studio. It doesn't do *nearly* enough.
6 Sep 2011 by #realJSOP
If you disable the keyboard and mouse, how do you expect to RE-enable with a keyboard key press or a mouse click?
9 Sep 2011 by #realJSOP
Why use regex? // I would personally make this an extension methodpublic static string ReplaceOccurrence(this string str, string target, string replacement, int count){ int pos = -1; int counted = 0; string result = ""; do { pos = (pos >= 0) ?...
21 Sep 2011 by #realJSOP
Go here [^]
30 Nov 2011 by #realJSOP
Wow, I didn't think I'd have to break out the ol' crystal ball this early in the morning. Here's an answer that matches the lack of information in your question, yet strangely applies to pretty much any program written in any language - write better code.
5 Dec 2011 by #realJSOP
Set permissions on the EXE as admin only, and don't make anyone else admin on the box.
7 Dec 2011 by #realJSOP
It's because you're looking for ' 0 ' instead of '0'. In other words, remove the padding for everything except the space character.
9 Dec 2011 by #realJSOP
Over 5 MILLION google results for the search phrase "steganograpgy c"[^]Man, even the hackers are gettin' lazy...
16 Dec 2011 by #realJSOP
I think you should learn Cobol - It starts with a 'C'.
20 Dec 2011 by #realJSOP
It's starting at each end of the character array, looking for character matches. Given the string "abccba", it's comparing the character at position 0 and 5, 1 and 4, and 2 and 3 to see if they're the same. If they are, it's a palindrome. If it runs into a pair that doesn't match, it's not a...
25 Feb 2012 by #realJSOP
It doesn't know where to find mysql.h.
8 Mar 2012 by #realJSOP
Go here [^]
9 Nov 2016 by #realJSOP
It is not recommended to use a case statement without some preprocessing that would probably involve using the dreaded if/else if... construct, but if you're just trying to be different, you could try this:int x = 0;string status = "";status = (status == "" && x >= 50) ? "You...
5 Feb 2017 by #realJSOP
Do not build query strings like that. You're setting yourself up for SQL injection. Use parameterized queries instead.
30 Oct 2018 by #realJSOP
Google is your friend. It appears to be related to uninstalling GoPro software (or something similar). No SPLib DLL was found in the Waterfall procedure - Google Search[^]
27 Mar 2019 by #realJSOP
use sprintf to format it with leading zeros.
16 Jul 2019 by #realJSOP
Try this: bool DoMyHomeworkFormMe(bool please) { return false; }
18 Oct 2019 by #realJSOP
Run it, and see what the output is. If the output isn't what is desired, use the debugger to step through the code to see where you went wrong.
16 Apr 2020 by #realJSOP
This code snippet:System.Drawing.Imaging.Encoder.Quality is how you control compression. The lower the value, the lower the resolution. Valid values are 0-100. If you'll notice, the image has to be in memory (as opposed to in a file) in order to...