15,300 Posted Topics

Member Avatar for tuse

Reputation, good and bad, means zero here in the Coffee House.

Member Avatar for Dani
0
121
Member Avatar for mayu
Member Avatar for jephthah
0
2K
Member Avatar for kurt2

[URL="http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm"]Here's[/URL] why floating point is not very accurate. It talks about Python but applies to all other programming languages too that use Intel Floating Point. If you need more accuracy then use one of the several [URL="http://www.google.com/search?hl=en&q=c%2B%2B+math+libraries"]alternate math libraries[/URL].

Member Avatar for kurt2
0
160
Member Avatar for narendharg

I have no idea what you mean by LOCATOR, but a linker is a program that creates an executable file from the object files and libraries.

Member Avatar for Salem
0
90
Member Avatar for Alex Edwards

The code you oposted has a huge memory leak. Line 24 allocates some memory then line 25 tosses the pointer away and uses it for something else. One of those two lines needs to be deleted. My preference is to keep line 24 and delete line 25 so that the …

Member Avatar for Alex Edwards
0
75
Member Avatar for cybx
Member Avatar for amarjot

From what I see on the net, an Excel Database is just another name for an ordinary Excel file and can be accessed as previously mentioned by Tesuji. Otherwise, you can access any ODBC compliant data base through the ODBC driver functions. There are several [URL="http://www.google.com/search?hl=en&q=ODBC+tutorial"]tutorials[/URL] and [URL="http://www.google.com/search?hl=en&q=ODBC+c%2B%2B+classes"]c++ classes[/URL].

Member Avatar for Ancient Dragon
0
94
Member Avatar for Thew
Member Avatar for ff4930

>>Im restricted from using STL btw. That means you might as well be writing a C, not a C++ program because you can't use anything from fstream, iostream, string, vector, map, etc. etc. With that restriction I would create a structure that contains an int for counter, another int for …

Member Avatar for ff4930
0
88
Member Avatar for scratchnloved

Are you talking about [URL="http://en.wikipedia.org/wiki/RSS_(file_format)"]RSS feeds[/URL] ?

Member Avatar for Ancient Dragon
0
91
Member Avatar for Noxes

1) Study c++ classes. You can create a character class that contains all sorts of skills or data types. 2) Study c++ classes. You can create a calendar that contains whatever dates or data types you want. Also study fstream class to save and read back the data to/from data …

Member Avatar for Ancient Dragon
0
247
Member Avatar for ladie-loo@hotma

We have an [b]IRC Chat Network[/b] button located on the right side of any DaniWeb window. You can chat with people here on DaniWeb.

Member Avatar for The Dude
0
78
Member Avatar for Ancient Dragon
Member Avatar for The Dude
2
58
Member Avatar for Zolookas

line 3 does not allocate any memory for that array and sprintf() doesn't allocate it either. [code] void cabext(const char *fname) { char command[1024] = {0}; sprintf(command,"cabextract -L -d /tmp/ %s",fname); system(command); } [/code]

Member Avatar for Zolookas
0
913
Member Avatar for FTProtocol

Its not a simple function call -- you have to code something that will such as 1) erase the icon, 2) wait a few milliseconds, and 3) redraw the icon. Repeat for as long as you want it to appear to be flashing. Don't ask me how to do it …

Member Avatar for Ancient Dragon
0
91
Member Avatar for sniper29

1) line 12: subscripts into arrays must be integers, not doubles. You have one of two choices here: either make the variables [b]i[/b] and [b]j[/b] integers on line 12 or typecast them to integers every place in your program where they are used as subscripts. Its a lot easier and …

Member Avatar for Ancient Dragon
0
221
Member Avatar for masoud87

I don't have either of those compilers. Why don't you just write a simple little program that demonstrates the problem and that can be compiled by any compiler, then compare the output with the results on other compilers. This one for example: I'm using win32 api function QueryPerformanceCounter() below because …

Member Avatar for Ancient Dragon
0
327
Member Avatar for Cybulski

Mutexs work with multiple threads or multiple processes. What you describe is not a problem if there are no other threads or processes that want access to the mutex at the same time. Add a Sleep() before the WaitForSingleObject() to allow time for other threads to gain access to the …

Member Avatar for Ancient Dragon
0
583
Member Avatar for henpecked1

In the base class the function should be declared a pure virtual function [icode]virtual void printtostream(ostream& out) = 0;[/icode] This will force one (or more) of the derived classes to provide the implementation for that function.

Member Avatar for henpecked1
0
127
Member Avatar for sanchit223

Did you code it like [URL="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.6"]this link[/URL] ? c++ classes and their methods are not useable from c. If you want to do that then you will have to create a c++ wrapper that can be called from C.

Member Avatar for Ancient Dragon
0
161
Member Avatar for opus2295

Welcome to DaniWeb. There are a few regulars here from Austrailia. I always wanted to visit your country, but probably never will.

Member Avatar for jasimp
0
27
Member Avatar for missy108

Welcome to Daniweb. You're in luck today because there are quite a few java experts here. All you have to do is post your questions in the Java Software Development board.

Member Avatar for selfhelpebooks
0
118
Member Avatar for zoner7

The data type [b]char[/b] is simply a one-byte integer. The maximum and minimum values for your machine and compiler are stored in the header file limits.h. Typically the maximum value is 127 and minimum value is -126. An unsigned char data type can store values in the range 0 to …

Member Avatar for Radical Edward
0
530
Member Avatar for driplet
Member Avatar for sniper29

[QUOTE=sniper29;624101]how can i make array on a function>????[/QUOTE] Do you know what a two-dimensional array is? Do you know anything at all about arrays? [code] int main() { int array[5][2]; // this is a 2 dimensional array } [/code] If you are having problems with the concepts of arrays then …

Member Avatar for jephthah
0
406
Member Avatar for theUnspeakable

Then you did it wrong. Post your code how you tried it. [icode]strand( time(0) );[/icode] should appear only once in your program, preferably near the top of main() before any loops or other executable code.

Member Avatar for Sky Diploma
0
94
Member Avatar for dinup.d

Welcome to DaniWeb. I think the place to start is by reading the threads in this [URL="http://www.daniweb.com/forums/forum120.html"]Getting Started forum[/URL]

Member Avatar for Jx_Man
0
69
Member Avatar for Ancient Dragon

I think its about time we add a new MS-Windows board that is specific to MS-Windows programming. Why? Because there have been several threads in the c and c++ boards (probably vb too) that are about windows programming instead of about c or c++. [URL="http://www.daniweb.com/forums/thread129099.html"]This thread [/URL]is a good example …

Member Avatar for Ancient Dragon
0
136
Member Avatar for kux

The solution is to find out what is the difference between clicking on the first column and clicking on the second column. In both cases I think your program should get the click event.

Member Avatar for Aashath
0
1K
Member Avatar for Cybulski

two problems: 1) ReaderThread must be a [b]static[/b] method of the class 2) remove the [b]&[/b] [icode]&MultiReader::ReaderThread, [/icode]. Like arrays all you need is the name of the method.

Member Avatar for Cybulski
0
881
Member Avatar for zoner7

>>I have a function inside another function that is called by main(). No you don't because nested functions are illegal in C and C++. The best way to do that is to pass the vector by reference and let the called function populate it. It would be done by passing …

Member Avatar for zoner7
0
116
Member Avatar for zoner7

why not just create the array in main() and pass it as a parameter [code] int CreateBoard(int Board[9][9]) { // all your code here return 0; } int main() { int Board[9][9]; CreateBoard(Board); return 0; } [/code]

Member Avatar for Ancient Dragon
0
109
Member Avatar for Pikachumanson

suggestion: change the color of the help menu because it can't be read. Dark blue on black background is nearly impossible to read. Why don't you just save the coordinates for all rooms then read all of them. [code] ifstream continueData; continueData.open("save.txt"); continueData >> playerName >> life >> x >> …

Member Avatar for Pikachumanson
0
261
Member Avatar for cmatos15

To withdraw money you will need to add another method to the Account class [code] //Definition of the Account class [class Account { public: Account( int ); // constructor initializes balance void credit( int ); // add an amount to the account balance void debit( int ); // subtract an …

Member Avatar for Ancient Dragon
0
138
Member Avatar for Ancient Dragon

It's taking a full 45 seconds to finish loading a thread (doesn't happen with menus). After clicking on a thread the first half of the firs posts load almost immediately, then something is waiting 45 seconds (yes I timed it with my watch) before the remainder of the information is …

Member Avatar for Ancient Dragon
0
124
Member Avatar for GallantAlex

>> but i would like to know if you could recommned me a site which has a list of all the commnads that I could use The only site I know of is [url]www.microsoft.com[/url]. Just type the name of the function in its search engine and it will locate the …

Member Avatar for William Hemsworth
0
486
Member Avatar for Phan

>character character; That only instantiates an instance of the structure -- it doesn't initialize it. There are at least two ways to initilize it: 1) in c++ you can add a constructor that initializes structure members 2) set members to something at the time of instantiation: [icode]character character = {0,0,0 …

Member Avatar for mitrmkar
0
132
Member Avatar for J_M44053

Ice tea straight up and diet coke. I drank a lot of coffee but had to give it up because it was wrecking my nerves.

Member Avatar for xtremeham
0
216
Member Avatar for Dannyo329

Just guessing here, but do you want main() to call a function that is another *.cpp file? For example, [code] // foo.cpp #include <iostream> int foo() { std::cout << "Hello World\n"; return 0; } [/code] [code] // main.cpp extern int foo(); int main() { foo(); return 0; } [/code] Now …

Member Avatar for mitrmkar
0
122
Member Avatar for bookworm619
Member Avatar for mitrmkar
0
417
Member Avatar for trembb22

win32 api function CreateThread(). Its the same for all versions of the compiler. Just look it up in MSDN for parameters -- most parameters can be 0.

Member Avatar for trembb22
0
297
Member Avatar for cheguashwini

Please post how you declared array1 and array2. Are they std::string objects or std::vector<std::string> objects? Or maybe even something else ?

Member Avatar for Ancient Dragon
0
131
Member Avatar for ff4930

If the file contains several lines as you described then after getline() you can use stringstream to divide it up into individual integers. Also note the difference in the while statement -- using eof() like that doesn't work. [code] #include <sstream> <snip> string line; ifstream myfile("input.txt"); if(myfile.is_open()){ while(getline(myfile, line) ) …

Member Avatar for Duoas
0
171
Member Avatar for Borgatto

Well, you can't use MFC because that is c++, not c. If you can use c++ then threre are several [URL="http://www.google.com/search?hl=en&q=mfc+tutorials"]MFC tutorials[/URL].

Member Avatar for Borgatto
0
110
Member Avatar for cam9856

Probably because there are a lot of compile errors. Add [icode]#include <string>[/icode] What compiler are you using. I used VC++ 2008 Express and it identified a bunch of errors. AmasiVillage: contains a recursive function call which will cause a runtime stack overflow. Maybe you meant to do this: [code] if …

Member Avatar for cam9856
0
103
Member Avatar for rajkiran718

you need to do that via sockets. [URL="http://www.google.com/search?hl=en&q=c+socket+tutorial"]There are quite a few tutorials[/URL].

Member Avatar for stephen84s
0
111
Member Avatar for herms14

>>array[i]= 0 + rand() % 100; That will not produce a random number between 1 and 100. Instead it produces a number between 0 and 99 inclusively. The instructions say nothing about generating 200 UNIQUE random numbers so I guess adding duplicate numbers to the array is not a problem. …

Member Avatar for mitrmkar
0
111
Member Avatar for csshacker

Have you tried reading the other threads here? because several of them have discusses the same thing as you asked. But don't ask me because I'm completly ignorant of that information.

Member Avatar for Deeapkkamboj
0
77
Member Avatar for AnjaliAnuradha

you can use the transform function from <algorithms> header file [code] vector<string> lst; for(int i = 0; i < lst.size(); ++i) { transform(lst[i].begin(), lst[i].end(), lst[i].begin(), toupper); } [/code]

Member Avatar for Nick Evan
0
134
Member Avatar for jks1234

Nice program requirements, but what do you want us to do about it? Please don't ask anyone to write it for you because we won't do that. Post what you have tried and ask questions.

Member Avatar for Ancient Dragon
0
102

The End.