473,543 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
0
153
thread by: arnuld | last post Jun 27 '08 by: arnuld
On Mon, 05 May 2008 22:02:10 +0800, ??? wrote: no, please don't see. I don't need your "see" -- http://lispmachine.wordpress.com/
26
2,554
thread by: mike-yue | last post Jun 27 '08 by: Richard Heathfield
The topic comes from a question: Would you rather wait for the results of a quicksort, a linear search, or a bubble sort on a 200000 element array? 1Quicksort 2Linear Search 3Bubble Sort The answer is 2Linear Search
0
144
thread by: William Pursell | last post Jun 27 '08 by: William Pursell
On 5 May, 07:45, apati...@gmail.com wrote: Much preferred is: char *path; FILE *infile; infile = fopen( path = "result.txt", "r"); if( infile == NULL )
40
2,618
thread by: jacob navia | last post Jun 27 '08 by: Joachim Schmitz
Recently we had poor Mr "teapot" that was horrified at the heresy of lcc-win of accepting // comments. C is a nice language, and you can do anything with it, inclusive a program that transforms // comments into well behaved /* ... */ ones... ------------------------------------------------cut here /*
1
1,543
thread by: Niz | last post Jun 27 '08 by: Bill Leary
On 2008-05-05 12:23:26 +0100, apaticul@gmail.com said: Use fgets() instead of gets() it is much safer.
5
1,185
thread by: Alexander Mahone | last post Jun 27 '08 by: Igmar Palsenberg
OK, I have this piece of code: void method(void* parameter) { 1: struct Data* dataOfReference=(struct Data*)parameter; 2: Info tmpInfo=(*dataOfReference).payload.data; 3: char* message; .... }
1
1,448
thread by: new | last post Jun 27 '08 by: Keith Thompson
struct abc { int x; char y; }; struct xyz { struct abc p; //LINE 1 int q;
14
1,288
thread by: Paulo Jorge de O. C. de Matos | last post Jun 27 '08 by: David Thompson
Hello all, I am trying to understand in detail the correct wording to use in C for teaching purposes. For the example: int foo(int x, int y) { int k; ... return k; }
1
1,189
thread by: Bartc | last post Jun 27 '08 by: Bartc
I need to be able generate C-style declarations from a specification (I call it a typespec) in left-to-right form (as it might be expressed in English). What is the algorithm, or where can I found the algorithm, to do so? I have looked at some code in K&R2 p126 ('undcl'), but that works on character input (I already have the typespec in...
36
1,436
thread by: kaps | last post Jun 27 '08 by: Ian Collins
Hello What is the best IDE to use for C/C++ languages? Previously I used "turbo c" compiler on Windows XP. But now I switched to Windows Vista where I cant use it. I tried to setup CDT eclipse but could not compile C program. Can somebody please tell me which IDE is best and from where to
5
1,946
thread by: Charles Sullivan | last post Jun 27 '08 by: Ben Bacarisse
Suppose I have this code: unsigned short svalue; unsigned char hibyte, lobyte; svalue = 0xABCD; hibyte = (svalue >8) & 0xFF; lobyte = svalue & 0xFF;
5
2,006
thread by: magicman | last post Jun 27 '08 by: Ben Bacarisse
thx
8
1,107
thread by: mdh | last post Jun 27 '08 by: rio
K & R 5-5 asks for a strncat function ( concat n characters of t); void mystrncat(char *s, char *t, int n) { while ( *s++); /* find end of s */ /* <<<<< 1 */ /* stops at '\0' */ /* <<<<<2 */
3
153
thread by: Flash Gordon | last post Jun 27 '08 by: Barry Schwarz
apaticul@gmail.com wrote, On 03/05/08 11:57: <snip> So you are not even doing C but C++ instead. Ask in the right place and it won't take months of waiting or swearing.
2
1,286
thread by: Bob Nelson | last post Jun 27 '08 by: Bob Nelson
WWDPD - Before posting to c.l.c, I try to ask the question ``What would Dan Pop do?''. With that in mind, I'm certain that Dan would never begin a message with a salutation such as ``Hi'', ``Hey'' or ``Hello''. As a oldtimer in this group, I don't recall usage of such salutations by Dan or anyone else for that matter back in the 1990's. I...
2
3,724
thread by: Vlad Dogaru | last post Jun 27 '08 by: Vlad Dogaru
On May 2, 7:52 pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote: Would memcpy and htons & co be a correct approach? My problem is that it's not only short ints that I have to accomodate, but also the occasional long; I'd like to have a uniform handling of these operations. Also, I'm not sure if the way I found to "deserialize" these values is...
8
1,513
thread by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post Jun 27 '08 by: vippstar
I'm working with a microcontroller at the moment that has a single instruction for clearing a bit in a byte. I started off with the following line of code: x &= ~0x8u; /* Clear the 4th bit */ But then I changed it to the following because I thought I might get more efficient assembler out of it:
16
5,255
thread by: spl | last post Jun 27 '08 by: christian.bau
To increase the performance, how to change the / operator with bitwise operators? for ex: 25/5, 225/25 or 25/3 or any division, but I am not bothered of any remainder.
0
885
thread by: santosh | last post Jun 27 '08 by: santosh
Antoninus Twink wrote: <snip> Not with Windows PowerShell, whose facilities are modelled after the Unix shells and even expanded upon in some areas. Also cmd.exe is quite capable, but COMMAND.COM is indeed "primitive" by modern CLI standards.
4
2,919
thread by: arnuld | last post Jun 27 '08 by: Richard Heathfield
This program follows from the section 6.5 of K&R2 where authors created a doubly-linked list using a binary-tree based approach. The only thing I have rewritten myself is the getword function. I am using it because there are many concepts involved in this program that I want to understand like: 1.) degree of efficiency of this program as...
3
2,991
thread by: NaN | last post Jun 27 '08 by: user923005
I've been trying to use _kbhit() but it didn't do what I thought it would from books, "Detects whether a keypress is available for reading." Herbert Schildt says, "If the user has pressed a key, this function returns true(non-0), but does not read the character. If no keystroke is pending, kbhit() returns false (0)." Here is the test...
12
1,913
thread by: nembo kid | last post Jun 27 '08 by: Kevin D. Quitt
How I (recursive) can reverse and print a string (as simple as possible)? I tried with the following code, but it doesn't work. Thanks in advance to everbody. /* Code starts here */ #include <stdio.h> void invstr(char* s) {
13
1,939
thread by: Jim Langston | last post Jun 27 '08 by: Chris Torek
I had asked this in comp.lang.c++ with out any answers that would actually work, so I'm hoping someone here may know a way. I am calling C library functions that want to output to stdout. I need to capture this to memory for use internally inside the program without modifying the library calls that actually do the output. This is for the...
7
1,948
thread by: Alex | last post Jun 27 '08 by: John Bode
The code below can't be compiled: typedef char* POINTER; const POINTER ptr; ptr++; The compiler (Sun C 5.8 Patch 121015-04 2007/01/10) complains: "test.c", line ...: operand must be modifiable lvalue: op "++"
8
5,693
thread by: aarklon | last post Jun 27 '08 by: CBFalconer
Hi all, see:- http://linuxgazette.net/issue51/pramode.html

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.