Forum: C++ Mar 16th, 2007 |
| Replies: 2 Views: 1,639 C version: returns pi/4
#include <stdlib.h>
double pi_over_4(int n)
{
double iter=3;
int eveodd=1;
double pi=0.; |
Forum: C++ Jan 18th, 2007 |
| Replies: 5 Views: 2,190 I guess I should add:
stdc allows the use of memcpy with the arguments you stated. What the compiler calls as its own version of run-time memcpy can have any number of aguments. A lot of the API... |
Forum: C++ Jan 18th, 2007 |
| Replies: 5 Views: 2,190 It's telling you that you're referencing NULL pointers. |
Forum: C++ Sep 6th, 2006 |
| Replies: 7 Views: 10,789 Are you talking about using NFA regexp in a DFA environment?
Start with a DFA tool is the simple answer. There really is no code to convert from one to another, because it doesn't make much sense... |
Forum: C++ Jul 29th, 2006 |
| Replies: 3 Views: 1,359 Not to inject extra complexity, but if you need to get those exterior circles to fit together into a nice ring, with each smaller circle touching it's neighbor and the circumference of the big one,... |
Forum: C++ Jul 11th, 2006 |
| Replies: 3 Views: 1,303 It sounds like you have to set bits to toggle pixels on the display?
Or does the display have an embedded driver to respond to ANSI tty commands? |
Forum: C++ Feb 20th, 2006 |
| Replies: 13 Views: 7,502 UNIX does - and you can create files with "holes" in them - literally.
In other words, a block (say 512 bytes) then a hole which uses ~twenty bytes but actually is say ten blocks of ASCII nul, then... |
Forum: C++ Feb 20th, 2006 |
| Replies: 13 Views: 7,502 FWIW -
opening an MS-DOS text file (FAT16) in binary mode doesn't necessarily work as described above. The reason is that the reported size of the file by the filesystem is not the same as the... |
Forum: C++ Feb 16th, 2006 |
| Replies: 4 Views: 8,396 IF you're on unix:
sort -t ',' k- 1,1 -o newfile.csv oldfile.csv
will sort the file the way you want - outside C++. |
Forum: C++ Feb 3rd, 2006 |
| Replies: 9 Views: 2,424 If your commands produce output consider using popen() which works like somewhat system() but allows one-way communication between the shell and the C program.
system() does'nt do that.
man... |
Forum: C++ Dec 1st, 2005 |
| Replies: 15 Views: 2,423 So, how did you compile and link the .so file? |
Forum: C++ Dec 1st, 2005 |
| Replies: 15 Views: 2,423 My bad.
Just to clarify:
1. You can link an entire module statically.
2. You can link just one or two libraries statically, and link the rest of the image dynamically:
cc myfile.c... |
Forum: C++ Nov 30th, 2005 |
| Replies: 15 Views: 2,423 No, no, not flags...
I'm assuming you're using C++ code - look for something like "libc++.a" and link against that. I don't know the name for the library file in Solaris. |
Forum: C++ Nov 30th, 2005 |
| Replies: 15 Views: 2,423 The "moving over" part is the reason for which static linking exists.
Your problem could be looked at another way: as an implementation/deployment issue.
Matching up correct code with correct... |
Forum: C++ Nov 30th, 2005 |
| Replies: 15 Views: 2,423 You're on the right track. I don't use Solaris, but I do know it has some (what I think are) funny conventions.
Now that I know it's Solaris, you can use versioning of your .so files, as long as... |
Forum: C++ Nov 30th, 2005 |
| Replies: 15 Views: 2,423 Yes. - it's called a static link. It means that all of the runtime you need is part of the image file - obviously a much bigger image file.
I can't tell which version of unix you have, but your... |
Forum: C++ Nov 18th, 2005 |
| Replies: 2 Views: 1,991 Have you tried running it in a debugger?
If you do a stack dump (backtrace)
it will show exactly where it bombed. |
Forum: C++ Nov 18th, 2005 |
| Replies: 3 Views: 3,434 The STL is fantastic, but C does not support it. It looks like the OP wants to work in C only. |
Forum: C++ Nov 18th, 2005 |
| Replies: 3 Views: 3,434 This works:
int main(int argc, char *argv[])
{
char table[5][10]={"Hello","Hello","Hello","Hello","Hello"};
int i=0;
for(i=0;i<5;i++)
{
printf("%d %s\n",i,table[i]);
} |
Forum: C++ Nov 16th, 2005 |
| Replies: 19 Views: 2,448 Whenever you compile C code you should enable warnings. Some compilers will not complain unless you tell them to complain.
What compiler are you using? Is it an ancient version
of BORLAND C++... |
Forum: C++ Nov 15th, 2005 |
| Replies: 2 Views: 1,143 http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
See section 2.12.3 - File & 2.12.5 Character I/O |
Forum: C++ Nov 14th, 2005 |
| Replies: 6 Views: 2,376 I'm posting this very small insertion sort routine in C - well after your post, and possibly a homework deadline, so you can see what one looks like.
typedef THING unsigned long;
/* n= number... |