473,543 Members | 2,003 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.
5
6,457
thread by: Apollyon | last post Nov 14 '05 by: CBFalconer
I'm trying to figure out if there's a function that takes a file pointer (FILE *) and will return a HANDLE type ... I'm trying to modify some code and I've looked everywhere to no avail. Thanks -- Apollyon
5
1,797
thread by: Mark T | last post Nov 14 '05 by: Mabden
Is there a free utility out there (Win32 or Linux) that will: recursively read thru your source code tree and output paths where it found any .h or .hpp files thanks
5
7,422
thread by: akins.steve | last post Nov 14 '05 by: Ross Kendall Axe
Is it possible to write a function that uses stdout for both output and input? What I mean to say is, I can obviously write a line to stdout to ask for input, ie: fprintf(stdout, "%s\n", prompt); Then in order to read the response, I would use: fgets(user_input, MAX_LINES, stdin);
5
3,427
thread by: Richard Delorme | last post Nov 14 '05 by: Chris Torek
The n869 draft says: J.2 Undefined behavior The behavior is undefined in the following circumstances: -- An array subscript is out of range, even if an object is apparently accessible with the given subscript (as in the lvalue expression a given the declaration
5
1,963
thread by: Richard | last post Nov 14 '05 by: Peter Nilsson
My experience has always been that you're SOL when trying to safely detect and stop references to dangling memory (non-null pointers to free'ed blocks) at runtime (C99, Linux). Maybe somebody clever has worked this out, though? (Apologies to those who find the question off topic for CUP or CLC)
5
12,512
thread by: L. Westmeier | last post Nov 14 '05 by: OSHIMA
Reading the man pages and some code did not really help me in understanding the difference between - or better when I should use - perror("...") and fprintf(stderr, "...") Any hint or help is appreciated. L. Westmeier
5
2,627
thread by: Aleksandar Milivojevic | last post Nov 14 '05 by: Aleksandar Milivojevic
I had to write implementation of strlcat() (some source from Microsoft I got was using it, and strlcat/strlcpy doesn't exist in my libc). Two quick questions. If NULL is not encountered in first _size_ bytes of _dst_, should strlcat() return _size_ + strlen(_src_), or should it return _size_? Some manual pages I found were not exactly...
5
3,208
thread by: Niklaus | last post Nov 14 '05 by: Arthur J. O'Dwyer
This is one of the posts that i got. ------------------------------ A "side effect" of an operation is something that *happens*, not something that *is produced*. Examples: In the expression 2+2, the value 4 *is produced*. Nothing *happens*. Thus, 4 is the value of the expression, and it has no side effects. In the expression g=2.0, the...
5
3,085
thread by: dustu | last post Nov 14 '05 by: dustu
Hi, I'm using lcc-win32 on Windows 2000 as compiler/IDE. The details are: Input file (sample - the no. of digits per line may change): ---> 1111111111111111.00 1111111111111111.01 1111111111111111.02 <---
5
1,773
thread by: Dennis Schulz | last post Nov 14 '05 by: Robert Bachmann
hi all, im a very beginner in c language and this is my try in writing / appending a struct in a file. unfortuately nothing is written into the file. especially the part with the pointer Fischzeiger seems very strange to me... but fwrite accepts a pointer as first argument, i dont know what else to do...
5
1,309
thread by: Nikola | last post Nov 14 '05 by: Chris Dollin
Compiler prompts a dosen errors Proffessionals, HELP! I's not english, try anyway ... thanks #include<stdio.h> #include<stdlib.h> #include<string.h> struct osoba {
5
4,609
thread by: Kevin C. | last post Nov 14 '05 by: Mac
udt_list *g_list = calloc(1, LIST_SIZE); udt_entry *entry = get_entry(); // returns a pointer to some address in g_list int numbytes = (char*)entry - (char*)g_list; // supposed to be offset in bytes But numbytes is -240. Can someone explain why?
5
5,549
thread by: Kevin C. | last post Nov 14 '05 by: Ross Kendall Axe
Never mind my last post about pointer subtraction, I traced the code and found the offender to be strcat. char call = "del "; system(strcat(strcat(call, del->table_name), ".tab")); After this line, trying to dereference del results in page faults or garbage. This makes me wonder how strcat is implemented, in terms of what it actually...
5
1,508
thread by: Critic | last post Nov 14 '05 by: Brian Quincy Hutchings
Actually, the refutation to this idiot appears on this website: http://www.counterpunch.com/mickey03302004.html Tommy Boy Friedman Does "Imagine" By MICKEY Z. "There is an odor to any press headquarters that is unmistakable...the unavoidable smell of flesh burning quietly and slowly in the service of a machine."
5
2,706
thread by: hpy_awad | last post Nov 14 '05 by: Lew Pitcher
can cobol read binary data written by fprintf (C function) ?
5
9,089
thread by: jose luis fernandez diaz | last post Nov 14 '05 by: Dan Pop
Hi, In the program below: #include <stdio.h> #include <stdlib.h> #include <errno.h> using namespace std; int main()
5
1,849
thread by: Guruz | last post Nov 14 '05 by: Mitchell
hi C gurus do anyone of u know how to write a program in C without main and still create a executable out of it. Remember, I said no main() function not in -->include files -->libraries -->no define thisthat main I mean absolutely no main() atall Well to start off here one method :
5
1,278
thread by: Daniel Rudy | last post Nov 14 '05 by: Daniel Rudy
Hello, How does one call a pointer? Basically, what I would like to do is have an array of pointers so that a value of a variable in a struct will act as an index to the array, which contains the addresses of routines. How does one do this in C? Can it be done? I'm still new to C, so some of the code below will not be valid...Like the...
5
3,661
thread by: Johnathan Doe | last post Nov 14 '05 by: August Derleth
Why is is necessary to write a function that allocates memory for, or changes, a pointer to a char array using char** instead of char*? E.g. void modify_string( char** string ) { if( string == NULL ) return;
5
8,416
thread by: anonymous | last post Nov 14 '05 by: Peter Shaggy Haywood
I have a Lex file containing definitions of 2 structures like: %{ struct a {...}; struct b { struct a i; ... }; struct a x;
5
3,583
thread by: Migrators | last post Nov 14 '05 by: Gordon Burditt
1)How is the memory structure organised in C. i.e., the way in which the stack and heap memory are used in C. 2) What will be the value of EOF.
5
1,896
thread by: mikegw | last post Nov 14 '05 by: Nick Keighley
Hello all. I am currently using an implementation of sysV shared memory. The entire shared memory is allocated is one continuous block of which I get the pointer to the head, everything should be done as offsets from this. At the moment I have two data structures, a head to a linked list which in it contains the pointer to the first...
5
3,312
thread by: luc wastiaux | last post Nov 14 '05 by: Dan Pop
Hello, I need to share a global variable between functions, and for clarity reasons, my code is split in different .c files that each compile into a ..o (object) which in turn are compiled together to form an executable. What would be a good place to declare my global variable ? Can I put in in a .h file that gets #included in all the .c's,...
5
2,074
thread by: pembed2003 | last post Nov 14 '05 by: Jack Klein
Hi all, I am reading the book "C How to Program" and in the chapter where it discuss scope rule, it says there are four scopes for a variable: function scope file scope block scope function-prototype scope I think(might be wrong):
5
1,508
thread by: buda | last post Nov 14 '05 by: buda
Hi, given the following code, .... int main( void ) { char *a = { "abc", "def", "ghijkl", "o", "prs" }; // for example .... }

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.