Forum: C 14 Hours Ago |
| Replies: 12 Views: 170 Bleh. I need to call it a night and leave better advice to others.
#include <stdio.h>
#include <string.h>
#define NAME_LEN 25
#define OWNER_LEN 25
#define STATUS_LEN 4
#define DATE_LEN 11... |
Forum: C++ 14 Hours Ago |
| Replies: 7 Views: 108 My assistance has been subpar tonight. Try this:
void loadFileToArray (string namesArray[], double gradesArray[][4], int &numberOfStudents)
{
string filename;
ifstream inputDataStream;
... |
Forum: C 23 Hours Ago |
| Replies: 7 Views: 110 Dunno.
#include <stdio.h>
#include <stdlib.h>
/**
* A simple line-counter. (Has issues with special cases.)
* @param file pointer to a file stream
* @return the number of lines in the... |
Forum: Geeks' Lounge 3 Days Ago |
| Replies: 7 Views: 257 int main(int O,char**I){int _[]={23,10,7,25,9,26,13,-1};if(I){O=0;}if(_[O]>-1){main(++O,0);putchar('|'-_[--O]);}return 0;}(Lame effort of mine, MS barks, gcc is ok.) |
Forum: C++ 3 Days Ago |
| Replies: 3 Views: 124 Keep track of the index of the highest value while taking input. Initialize to the first element:
int hi = 0;
When you find a new highest value, capture the index:
if ( votes[i] >... |
Forum: C 8 Days Ago |
| Replies: 7 Views: 316 Try printing the bytes in the buffer rather than printing the buffer as a string (especially when you are not treating buffer as a string). |
Forum: C 9 Days Ago |
| Replies: 1 Views: 189 Expected input and output would be helpful. Providing a small snippet of a simple test, minimal but complete and compilable, would too.
"This code doesn't do what I want (and I'm not going to tell... |
Forum: C 11 Days Ago |
| Replies: 14 Views: 613 *sigh*
Of course it is. ALL structures of the structures in the first example are populated at compile time. A particular one isn't "selected" in the if tree. |
Forum: C++ 14 Days Ago |
| Replies: 11 Views: 424 That happens to be true for the garden variety PC of today, but it is not true as a generic statement. |
Forum: C++ 16 Days Ago |
| Replies: 5 Views: 301 |
Forum: C++ 18 Days Ago |
| Replies: 5 Views: 318 http://groups.google.com/group/comp.lang.c/browse_thread/thread/2aaf5360b08c89a9/1000b1f7fb33ea53?ie=UTF-8&q=float+promoted+double+function+group%3Acomp.lang.c&pli=1 |
Forum: C++ 19 Days Ago |
| Replies: 3 Views: 233 #include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "RAND_MAX = " << RAND_MAX << "\n";
return 0;
} |
Forum: C++ 19 Days Ago |
| Replies: 4 Views: 190 You can't pass an array by value ("the whole array"). When you "pass an array", you instead pass a pointer to the first element. What I believe you are doing is writing to a random memory location... |
Forum: DaniWeb Community Feedback 25 Days Ago |
| Replies: 7 Views: 581 Right. In every other forum I frequent, I change the font to Courier New. Once upon a time, we could do that here. And that is what I was trying to say. |
Forum: C++ 26 Days Ago |
| Replies: 6 Views: 427 Well, choose your poison: multiple passes of the same file, or a single read with a buffer. Both are relatively simple, I'd recommend just examining what's there. Experiment a bit. Learning to code... |
Forum: C 27 Days Ago |
| Replies: 2 Views: 254 fmod (http://web.archive.org/web/20050207005628/http://dev.unicals.com/papers/c89-draft.html#4.5.6.4) |
Forum: C++ 27 Days Ago |
| Replies: 12 Views: 369 You're going to return from main in one of two places:
int main ()
{
int number;
int counter = 0;
int flags = 1;
bool flag_none = true;
bool fag_yes = false;
cout << "Enter a number,... |
Forum: C++ 32 Days Ago |
| Replies: 7 Views: 232 Just sayin'.
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
/* Extract value for # of elements in array */
int i; |
Forum: C 33 Days Ago |
| Replies: 2 Views: 195 Do you really think this is enough information for any kind of an answer? |
Forum: C++ Oct 25th, 2009 |
| Replies: 14 Views: 339 for ( int x=0; x<3; x++ );
Do you know what the semicolon does to your intended loop? |
Forum: C Oct 25th, 2009 |
| Replies: 6 Views: 202 http://c-faq.com/stdio/scanfhang.html |
Forum: DaniWeb Community Feedback Oct 24th, 2009 |
| Replies: 43 Views: 4,767 Another vote for the DevShed approach? (Where even 0 rep bumps have attributions, and commenting available as to a reason why?)
:icon_razz:
I don't think I'd be a fan of time limits. I think... |
Forum: C++ Oct 22nd, 2009 |
| Replies: 2 Views: 227 template <typename Comparable>
typename LeftistHeap<Comparable>::LeftistNode*
LeftistHeap<Comparable>::merge( LeftistNode *h1, LeftistNode *h2)?
... |
Forum: C++ Oct 22nd, 2009 |
| Replies: 6 Views: 336 You kinda need to know whether the binary contains LE or BE data.
Some somewhat related FAQs:
http://c-faq.com/misc/endiantest.html
http://c-faq.com/cpp/ifendian.html... |
Forum: C++ Oct 22nd, 2009 |
| Replies: 9 Views: 528 Where'd the 28 go and the 20 come from? |
Forum: DaniWeb Community Feedback Oct 21st, 2009 |
| Replies: 15 Views: 1,524 Let's look at a few examples of how I might use it "inline code" tags:
I kinda find it a pain in the ass to type out the tags for something like = or %02d or where I use them several times... |
Forum: C++ Oct 19th, 2009 |
| Replies: 17 Views: 425 Some starters: Sort out your confusion about strings and numbers. Assignment is =, comparison is ==. Multiline blocks are not determined by indentation in this curly-brace language. |
Forum: DaniWeb Community Feedback Oct 19th, 2009 |
| Replies: 15 Views: 1,524 Can you add the button to the Quick Reply? I tend to use it (as previously mentioned ad nauseum :icon_razz:) for anything in which fixed font helps text stand out better. In fact, I probably use it... |
Forum: C Oct 19th, 2009 |
| Replies: 6 Views: 266 Go back and look at that link I'd posted, I'm sure it mentions code tags at some point.
Do you know which language you are using? You seem to have merrily mixed C and C++ (perhaps "borrowing" code... |
Forum: C++ Oct 15th, 2009 |
| Replies: 18 Views: 960 And this differs from using push_back with some "default" strings how?
My "Ballpark?" example was how I understood the question neithan was asking: |
Forum: DaniWeb Community Feedback Oct 13th, 2009 |
| Replies: 25 Views: 2,203 A preview of what I've mentioned several times. |
Forum: C++ Oct 11th, 2009 |
| Replies: 5 Views: 407 http://wiki.osdev.org/Main_Page |
Forum: C++ Oct 9th, 2009 |
| Replies: 18 Views: 960 Ballpark?
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{ |
Forum: C++ Oct 9th, 2009 |
| Replies: 7 Views: 396 http://cboard.cprogramming.com/c-programming/56441-can-someone-help-me-understand-example-program.html#post394525 |
Forum: C++ Oct 8th, 2009 |
| Replies: 5 Views: 362 http://david.tribble.com/text/cdiffs.htm |
Forum: C++ Oct 8th, 2009 |
| Replies: 3 Views: 191 else if ( delta == 0 ) // compare, don't assign! |
Forum: C++ Oct 6th, 2009 |
| Replies: 6 Views: 306 Here is an old example I'd forgotten about; it may be of some use with regard to splitting a standalone chunk of code into header(s) and source file(s):... |
Forum: C++ Oct 5th, 2009 |
| Replies: 6 Views: 306 Sooner or later you'll need to learn that this is the wrong thing to do. Generally you want to put the interface (class definition, function prototypes, etc.) in the header, and put the... |
Forum: C Oct 4th, 2009 |
| Replies: 8 Views: 65,097 Why not post this failing example so I know what you mean?
Brought up recently by tux4life and explained by Narue (http://www.daniweb.com/forums/post956935.html#post956935), the fgets/sscanf code... |
Forum: C++ Oct 3rd, 2009 |
| Replies: 6 Views: 410 Folks might find it helpful if you'd post "Plot.h". |