... ...and you could also use a function to simplify: #include <stdio.h> static char get_reply(const char *prompt) { char buf[100], c; printf("Enter %s:\n",...
... It's clearly invalid, due to the existence of huge amounts of prior art. If corporations want to waste their money on patenting things like this, let them...
Dear all, I allocated memory to one array, which stores data from one file, and I made a condition that if one data being read using fscanf() is larger than...
... It's a good idea to use fgets(), where you can specify a maximum number of characters to read. If you malloc() 42 bytes then tell fgets() to read 42...
... In the case of fgets(), a terminating '\0' is helpfully included in the count, unlike most string functions where a string of n chars needs storage of n+1...
... And don't forget that fgets() adds a '\n' to the end of the string if there are n-2 or less characters in the input. Actually I think what the OP was...
... Are you trying to read a whole file? If so, why? ... Only if it is dynamically allocated. Since you haven't shown any code, most of the replies have...
... First you need to come up with a data structure to represent polygons. Then you need an algorithm to work out whether a point is inside or outside the...
I have a old but looks like a good book on learning c++ it uses a codewarrior professional 5 series. Do's anybody know is this version still available new or...
hi, I came across several books named "brain-friendly" and think this term is cool, so I use it here. :) To C beginners, I hope my explanation would help you...
... Hi Frank, What you have written is interesting, but I'm not sure it will help beginners. I think they would be better just learning how to use the stdarg.h...
I am trying to work on an old project that a coworker developed under MVS 2005. He has since left the compnay and I've pulled the project out of our source...
... You can call v.empty() to determine that. ... vector<char> is a datatype. You can't call vector<char>.empty(). Your question is equivalent to: int x = 42;...
... Your question is turning into a riddle. You may want to read this: http://en.wikipedia.org/wiki/Vector_(STL) And refer to a decent C++ book that covers the...
Hi, it's me again. :) I'm almost finished with my school project, the only thing I need is to find and count such numbers in an array (it's a matrix) that...
... Use two loops, an outer one for the rows, and an inner one for each cell within the row. Steve -- (o< www.stevesearle.com //\ Powered by Fedora ...
Hi all, I am sure this question has been discussed many times... but once more I got a code written in C, it makes use of the type: long long int code compiles...
sorry if you thought it was a riddle, I just finished writing a code for several people to perform some tasks and the code worked. It was setting up the...
... ...with a test that the cell isn't the one in the middle. Alternatively, use a function that takes a cell position relative to the cell of interest in...
... Think carefully about what you mean by "in their surroundings". For example, do diagonally adjacent numbers count as neighbours, or only vertically and...
... Just because .NET is in the name doesn't mean it always links against the .NET runtimes. Most people use VC++ for what it is intended for - authoring...
... Yes, actually. http://dn.codegear.com/museum That and India hasn't understood that Turbo C is an ancient compiler and still probably has warehouses of it....
... I second the IDE. That and the IDE (assuming it is halfway decent) makes debugging code a zillion times easier. A good IDE will automagically manage...
... You can abbreviate this to just "long long". ... Works for me. $cat long-long-test.cpp long long int slot_pattern = 0ll; $make long-long-test.o c++ -O2...
... It can still be useful to have a makefile - where I work engineers have to be able to rebuild some of the in-house utilities we use themselves (in Linux)....