Search Results

Showing results 1 to 40 of 564
Search took 0.15 seconds.
Search: Posts Made By: niek_e
Forum: C++ 8 Days Ago
Replies: 7
Solved: Ar ray help
Views: 267
Posted By niek_e
You're probably thinking that you're resizing array's here:

int room_numbers[0][0];
string room_titles[0];
string room_description[0];
[....]
total_rooms =...
Forum: Computer Science 10 Days Ago
Replies: 3
Views: 414
Posted By niek_e
Correct.


Depending on what kind of data you're sending, so might need less stuffing if you use two bytes. Because the chance that the pattern of 2 bytes is in your data is a lot smaller then...
Forum: C++ 16 Days Ago
Replies: 5
Views: 205
Posted By niek_e
change #include <string.h> to : #include <string>

This should never have not compiled in G++, so that's strange..
Forum: C++ 17 Days Ago
Replies: 11
Views: 464
Posted By niek_e
And why are you using "fprintf" and char-arrays in C++ code? This is the root of all your evil. Use std::strings instead.
Forum: DaniWeb Community Feedback 17 Days Ago
Replies: 3
Solved: Dear Adatapost
Views: 422
Posted By niek_e
And the reason why you posted this in a forum instead of a PM is ....?

Be warned that you're pretty close to getting the last infraction that'll get you banned. Under "keep it pleasant...
Forum: Visual Basic 4 / 5 / 6 18 Days Ago
Replies: 4
Views: 265
Posted By niek_e
You need an extra variable. After you say: Text1.Text = Text2.Text text1 and text2 will both have the same text (from text2), so this Text2.Text = Text1.Text is useless.

Use something like:

tmp...
Forum: Assembly 23 Days Ago
Replies: 1
Views: 423
Posted By niek_e
From PM:



We don't delete posts here. You can just ignore this thread and mark it as 'solved' to ensure that no-one wasts his/her time on this.
Forum: C++ 23 Days Ago
Replies: 10
Views: 408
Posted By niek_e
I think you misunderstood me. Change all the getline(cin.ignore(), new_modify); back to getline(cin, new_modify);

What I meant was this:


int i =0 ;
string something = "";
cin >> i;...
Forum: C++ 23 Days Ago
Replies: 10
Views: 408
Posted By niek_e
Put a cin.ignore() after every cin >> ......
The reason (http://www.daniweb.com/forums/thread90228.html)you don't get a change to input anything is because "cin >>" leaves a '\n' on the input...
Forum: C++ 23 Days Ago
Replies: 10
Views: 408
Posted By niek_e
I suggest you use getline() to get input from the user. Getline takes in input until a newline (enter) is detected. This is handy in you case, because you need 2 words (first and last name).

To...
Forum: C++ 24 Days Ago
Replies: 9
Views: 429
Posted By niek_e
Vectors are indeed the way to go. But not with fixed sizes as recommended to you by 'other people'. Here's an example of what I mean:

#include <vector>
#include <iostream>

int main(){
...
Forum: C++ 26 Days Ago
Replies: 7
Views: 399
Posted By niek_e
We (try to) help everyone here from beginner to pro. So stick around ;) We all started out at the bottom.
Forum: C++ 26 Days Ago
Replies: 7
Views: 399
Posted By niek_e
this is wrong: mi = KM_MI * km;

"KM_MI" == km per mile. So if you already have km and want to go to miles, you should divide by this number, not multiply:
mi = km / KM_MI ;
Same error is in...
Forum: C++ 34 Days Ago
Replies: 6
Views: 686
Posted By niek_e
This may very well be the best post I have ever read on Daniweb. :icon_mrgreen:
Forum: C++ Nov 18th, 2009
Replies: 5
Views: 261
Posted By niek_e
You need to change this line:
cout << “ ‘s bonus is ” << bonus << endl;
to:
cout << " bonus is " << bonus << endl;

without the fancy quotes, but with the plain old ones.


also: What...
Forum: Python Nov 17th, 2009
Replies: 2
Views: 259
Posted By niek_e
You're using the pop() method of a list. It pop's a value from a list at INDEX x, not a VALUE x. So when you say that if i is smaller then 0: pop i You're removing the item at INDEX i. So when i ==...
Forum: Geeks' Lounge Nov 16th, 2009
Replies: 4
Views: 506
Posted By niek_e
What kind of 'bot'? I hope you're not talking about spam and/or viruses. That would make me very unhappy with you :icon_frown:
Forum: C++ Oct 22nd, 2009
Replies: 5
Solved: MFC Tutorial
Views: 468
Posted By niek_e
I learned it from here (http://www.functionx.com/visualc/)
Forum: C++ Oct 21st, 2009
Replies: 3
Views: 343
Posted By niek_e
You forgot to #include <sstream>
Forum: DaniWeb Community Feedback Oct 18th, 2009
Replies: 9
Solved: Name change
Views: 1,100
Posted By niek_e
William is a *special* kind of guy ;)
Forum: C++ Oct 16th, 2009
Replies: 9
Views: 380
Posted By niek_e
isdigit expects only 1 character, but you're giving it an char-array. That's because strtok returns an array of characters. See this page (http://www.cplusplus.com/reference/clibrary/cstring/strtok/)
Forum: C++ Oct 9th, 2009
Replies: 25
Solved: C++ problem
Views: 616
Posted By niek_e
Yes you can. But then you have an uninitialized variable in your program. That's a bad thing. That's why I said: string name="";
Forum: C++ Oct 9th, 2009
Replies: 25
Solved: C++ problem
Views: 616
Posted By niek_e
Why don't you use a string for input? No need for char-arrays here, if you use std::getline(). Example:


#include <iostream>
#include <string>

using namespace std;

int main(){
string...
Forum: C++ Oct 9th, 2009
Replies: 25
Solved: C++ problem
Views: 616
Posted By niek_e
Why do you want to change a string to a char? A char is ONE character, no more.
Post your newest code, with input and expected output.
Forum: C++ Oct 9th, 2009
Replies: 5
Solved: Poll: readout
Views: 278
Posted By niek_e
So exactly why didn't you try my code?
Forum: C++ Oct 8th, 2009
Replies: 5
Solved: Poll: readout
Views: 278
Posted By niek_e
Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().


int main(){
// do stuff
std::cin.get();
return 0;
}
Forum: DaniWeb Community Feedback Oct 6th, 2009
Replies: 3
Views: 530
Posted By niek_e
Those damn slaves!
Forum: Geeks' Lounge Sep 30th, 2009
Replies: 3
Solved: View Profile
Views: 329
Posted By niek_e
Yeah, I actually reported is as a bug, but it turned out to be new and "improved" ;)
Forum: DaniWeb Community Feedback Sep 29th, 2009
Replies: 14
Views: 936
Posted By niek_e
Problem already confirmed for IE, but now Firefox (3.0.14/XP) is also showing the bug.
11846
Forum: DaniWeb Community Feedback Sep 24th, 2009
Replies: 14
Views: 936
Posted By niek_e
My guess is that is has something to do with this (http://http://www.daniweb.com/twitter/tweet225345.html)
Forum: C++ Sep 24th, 2009
Replies: 4
Views: 357
Posted By niek_e
40 members are a bit too much IMO. Have you considered using more then 1 class? For example:

class Human {
public:
Human::Human(std::string name, std::string last_name, int age);
private:...
Forum: C++ Sep 23rd, 2009
Replies: 4
Views: 363
Posted By niek_e
As I said, to seed the randomgenerator
(http://www.cplusplus.com/reference/clibrary/cstdlib/srand/)

If you have time, you should read this (http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx)
Forum: C++ Sep 23rd, 2009
Replies: 4
Views: 363
Posted By niek_e
did you seed the random-generator with srand() ?

Something like:

srand(time(NULL));
cout << rand()%v.size();
Forum: C++ Sep 22nd, 2009
Replies: 12
Views: 532
Posted By niek_e
I'm not sure about this, because I don't use managed code, but it looks like there's one ^ missing right before (1000). So perhaps:

List<List<String^>^>^ vector1 = gcnew...
Forum: C++ Sep 22nd, 2009
Replies: 6
Views: 323
Posted By niek_e
You could use a loop that does 2 thing:
1. Check if there are still lines available in the file.
2. Check if the current linenumber is the line number you want.

example:


#include <iostream>...
Forum: C++ Sep 22nd, 2009
Replies: 6
Views: 323
Posted By niek_e
Here's a tutorial (http://www.cplusplus.com/doc/tutorial/files/). Read it, and come back when you have questions/difficulties.
Forum: C++ Sep 22nd, 2009
Replies: 12
Views: 532
Posted By niek_e
Short answer: you can't. Vectors and Lists are both sequence containers, so you'll need a "list of vectors" or a "list of lists" if you want to keep the structure in your data.

If you don't want...
Forum: C++ Sep 20th, 2009
Replies: 5
Views: 608
Posted By niek_e
Your compiler isn't lying. You didn't delcare a, b,c or d here:

int main(void)
{
DivSales divSales;
divSales.addTotal(a,b,c,d); // <--- here
[....]


You should call the function...
Forum: C Sep 18th, 2009
Replies: 5
Views: 877
Posted By niek_e
Your logic is wrong. 1 KM == 1000 M == 100000 CM.
Forum: C++ Sep 16th, 2009
Replies: 19
Views: 650
Posted By niek_e
I'll take a guess: Compiler error. :icon_wink:
You probably meant: cout << i;
Showing results 1 to 40 of 564

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC