The shell command $ avrdude -c usbtiny outputs text to stderr. I cannot read it with commmands such as head-less-more cos it is not stdout. I want the text to stdout or to a file. How can I do it in C? I have tried to solve the problem by my last question but still unsolved.
...
So I started learning C today, and as an exercise i was told to write a program that asks the user for numbers until they type a 0, then adds the even ones and the odd ones together. Here is is (don't laugh at my bad style):
#include <stdio.h>;
int main() {
int esum = 0, osum = 0;
int n, mod;
puts("Please enter some number...
I downloaded pidgin source code and i don't know where to start from ..
Can any one pls ;) point the right way to understand that program ?
and also tell how to compile it on windows system .. it has manuals to compile on a Linux system but not windows .
...
The "impossible" K&R exercise.
"Write a program entab that replaces
strings of blanks by the minimum
number of tabs and blanks to achieve
the same spacing. Use the same tab
stops, say every n columns. Should n
be a variable or a symbolic
parameter?"
The problem I'm having is, I'm unsure about how to even do this corre...
Efficient way to determine if the number has identical digits in C
...
How can I get the path of home directory in Mac OS X using C language in XCode editor.
...
Hi,
How can i create a temporary folder in /tmp directory.
...
I create an array, similar to classic C (not NSArray or one of it's children) - something like BOOL i[5];. And I want to make all its values to be equal to NO.
First of all, I didn't found any information about initial values of such arrays (I know that in classic C they will be undefined, but don't know exactly about Objective-C. I fou...
Hi, so I asked here few days ago about C# and its principles. Now, if I may, I have some additional general questions about some languages, because for novice like me, it seems a bit confusing. To be exact I want to ask more about language functions capabilities than syntax and so.
To be honest, its just these special functions that bot...
Is it possible to access 32-bit registers in C ? If it is, how ? And if not, then is there any way to embed Assembly code in C ? I`m using the MinGW compiler, by the way.
Thanks in advance!
...
I use qsort from C libary and I have datatype
Element_type **pElement and Element_type is struct typedef element_type {int ,char ....}
example, and i call quicksor function with
qsort(*pElement,iCountElement,(size_t)sizeof(Element_type),compare);
and callback function
static int compare(const void *p1, const void *p2) {
E...
Hi,
How can i copy multiple char* variables into one char* at single instance operation.
say i have
char* text1 = "Hello";
char* text2 = "World";
i want to copy text1, text2 and '2' and "12345" into char* text3 in single function call.
...
I develop my app in linux for both unix and win32(cross compile at each build) plataforms, so a ready to use function would be nice :). I'm using glib that has the 'gchar* g_get_current_dir(void)' function and it returns the current directory, but what I really need is the executable's dir. I'm inexperienced in C programming so any suge...
Hi,
How can i get the paths of a folder and its content. Say i have folder named MyFolder as
/tmp/MyFolder/ where it has subfolders SubFolder1, SubFolder2... and some files
...
Right now I'm drawing a cube with OpenGL, I'm using Windows and WGL context. I have blending enabled so my cube looks semi transparent. Basically the background == the clear color (Black). I'd like to be able to save the image in raw RGBA format which I can then make into a png. I basically want the cube to blend in with a NULL backgroun...
I have a large data file that is created from a shell script. The next script processes it by sorting and reading several times. That takes more than 14 hours; it is not viable.
I want to replace this long running script with a program, probably in JAVA, C, or COBOL, that can run on Windows or on Sun Solaris. I have to read a group of r...
I was very surprised when I saw this notation. What does it do and what kind of C notion is it?
...
I have compared gcc assembler output of
do{
//some code
}while(0);
with
do{
//some code
break;
}while(1);
The output is equal, with or without optimization but..
It's always that way?
No experiment can prove theories, they can only show they are wrong
And because (I hope) programming is not an experimental science,
and...
Following function is used to get the page's base address of an address which is inside this page:
void* GetPageAddress(void* pAddress)
{
return (void*)((ULONG_PTR)pAddress & ~(PAGE_SIZE - 1));
}
But I couldn't quite get it, what is the trick it plays here?
Conclusion:
Personally, I think Amardeep's explanation plus Alex B's exam...
test.c:
#include "file.h"
In the above statement, which directories will be searched ?
I suppose the directory where test.c locates will be searched, right?
But is that all?
BTW, what's the benefit to use a header file? Java doesn't require a header file...
...