2011/3/7-4/20 [Computer/SW/Languages/C_Cplusplus] UID:54056 Activity:nil | 3/7 I have a C question. I have the following source code in two identical
files t.c and t.cpp:
#include <stdlib.h>
int main(int argc, char *argv[]) {
const char * const * p1;
const char * * p2;
...
|
2004/12/14-15 [Computer/SW/Compilers] UID:35291 Activity:moderate | 12/14 If I have a C function like this
void foo(void) {
static const char unused1[] = "one";
const char * const unused2 = "two";
...... some code ......
return;
...
|
2004/8/10-11 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:32805 Activity:high | 8/10 C question. Is there anything wrong with the following?
const my_struct_t **pp;
pp = malloc(sizeof(my_struct_t *));
pp = realloc(pp, sizeof (my_struct_t *) * 2);
"gcc -Wall" doesn't complain. But the M$ compiler (cl.exe) complains
about the realloc line:
...
|
2003/12/8-9 [Computer/SW/Languages/C_Cplusplus] UID:11356 Activity:nil | 12/8 c++ question, how do I overload << in my class so it will handle
endl? ie: myclass << "some string" << endl
I know how to do the "some string" part:
myclass & operator << (const char * s);
what about endl?
Thanks!!
...
|
2003/9/10 [Computer/SW/Languages/C_Cplusplus] UID:29529 Activity:nil | 9/10 Stupid question: how do I reference a C callback?
int mycompare(void const *a, void const *b) { ... }
qsort(msg, sizeof(Msg), numMsgs, mycompare);
I get
"Type error in argument 4 to `qsort'; calling convention mismatch."
\_ There's nothing wrong in the you reference it. However, you should
...
|
2002/7/13-15 [Computer/SW/Languages/C_Cplusplus] UID:25351 Activity:moderate | 7/13 how do i pass variables to the system in C ? e.g.
system("echo input is %s", argv[1]);
results in "input is %s" but I want the system to see argv[1]
(I know i can just use printf, but not for what i really want to do).
\_ sprintf into array, pass array to system?
\_ so write your own function that takes a variable number of
...
|
2001/9/23-24 [Computer/SW/Languages/C_Cplusplus] UID:22600 Activity:moderate | 9/23 let's say there's a C library you want to use called libmdn.so.
I think to load it you'd go something like:
static { System.loadLibrary("mdn"); }
However, let's say that a function call looked like this:
mdn_result_t mdn_encodename(int actions, const char
*from, char *to, size_t tolen)
...
|
2001/3/17-18 [Computer/SW/Languages/C_Cplusplus] UID:20827 Activity:high | 3/16 Why does so much C sample code use #define instead of const?
\_ because any good C code will use a bunch of preprocessor
anyways. you can't be a good C programmer and eschew the
preprocessor. For that, you need a language which fills those
gaps with other constructs (c++ templates go a long way to
obviate the need for preprocessor for example). you
...
|
2000/6/21-22 [Computer/SW/Languages/C_Cplusplus] UID:18506 Activity:very high | 6/20 I have a variable inside a struct. I want to be able to initialize
that variable ONCE and not write to it again. Any subsequent writes
should not be permitted. Is there a way to do that in C? I know
about "const int foo = 5;" but the value I need to pass in is dynamic
and happens at runtime. Declaring a variable as const doesn't let
me assign anything to it at all. Thanks.
...
|
2005/8/18-19 [Uncategorized/German] UID:39171 Activity:moderate | 8/18 Das haben wir gleich.
In Ordnung.
Ihr entkommt mir nicht!
\_ Heil cherman john guy, stat! Please show this person that a _real_
German haiku would get the syllables right. -John
\_ Obviously, you don't use Yahoo Messenger's new International
...
|
2005/7/15-16 [Uncategorized/German] UID:38648 Activity:nil | 7/15 OTM arekordjahr 2004.
http://csua.org/u/cpu [ reuters ]große Politik des
\_: "Mexikaner verfing sich durch die STAATRANDPATROUILLEN, die zu
enter das Land illegal werden normalerweise sofort zu
their. Viele warten einfach einen Tag und versuchen dann sneak
theland wieder.",
...
|
2005/5/3 [Uncategorized/German] UID:37506 Activity:nil | 5/3 der Unterschied zwischen Tony Blair und Dubyas Rathaussitzungen:
Late letzte Woche, bei einem seiner rituellen grillings - dieses
television Programm "Fragezeit" - die Publikum booed als er
appeared und wurde dann sogar feindlicher. "das eine Lüge ist! Sie
to dieses Land und das ist, warum wir nicht Sie stützen können!"
young Mann, Blair von die Intelligenz ungefähr übertreiben
...
|
2004/3/5 [Uncategorized/German] UID:12532 Activity:high Edit_by:auto | ACHTUNG!!!!
Das Soda ist nicht fuer warezhausen oder mailspammen. Ist easy
pissenoffen die rooten und overloaden das wallall mit die fuck-youen
und die yer-momen. Ist nicht fuer gewerken bei das majorfuckentwinken.
Das diskhoggen pornseeren keepen das bandwit-hosen hands in das
pockets muss. Relaxen und watchen das wallflamen.
...
|
2002/3/28 [Uncategorized/German] UID:24253 Activity:nil | 3/26 Ich bin der Nebel. Mit mir muss rechnen. Der auf das Wasser
hinausfa"hrt. Tausend Jahren hat man keinen gesehen. Der ihn
der Luft herumfliegen will. Wer bist du, eigentlich?
\_ Wat da hel?
\_ ACHTUNG! Alles touristen und non-technischen peepers!
Das machine control is nicht fur gerfinger-poken und mittengrabben.
...
|
|