1,171 Posted Topics

Member Avatar for FaNtEcH

[QUOTE=FaNtEcH;868758]Oh well..you asked for it.[/QUOTE] Actually there's no need for rapidshare, and if you've big code you can always attach your source to this thread :)

Member Avatar for tux4life
0
2K
Member Avatar for deepglue555

If you're talking about the C++ class [I]basic_string[/I] then you can just pass a string to a function in the same way as you're doing with a normal variable :) ... e.g.: [CODE] void strFunc([B]string s[/B]) { cout << s << endl; } [/CODE]

Member Avatar for deepglue555
0
266
Member Avatar for Liszt

Go to: [ICODE]Build>Configuration Manager[/ICODE] Edit:: Sorry, I didn't read your question thoroughly :(

Member Avatar for Liszt
0
179
Member Avatar for Liszt

You could get the computer's hard disk ID (hardware key), you can find some source code on how to do this [URL="http://www.winsim.com/diskid32/diskid32.html"]here[/URL], but as already said the user can always replace a 'dead' part in his computer, so dealing with a unique computer ID will be way more difficult than …

Member Avatar for Liszt
0
240
Member Avatar for jtltgl

Could you please post using code tags? And by the way: your code is still using the C file handling this isn't wrong but in C++ the C++ way for File I/O is preferred :) [QUOTE=jtltgl;865598] i need help in modifing code to count the number of records the '\n' …

Member Avatar for jtltgl
0
132
Member Avatar for Aamit

Are you sure that you're a software engineer (as described in your profile) ? [CODE] 10 20 30 40 [/CODE] (Just display the array) [CODE] 10+20 10+30 10+40 20+30 20+40 30+40 [/CODE] (Take the first element and display all the elements after it, take the second element and display all …

Member Avatar for siddhant3s
0
502
Member Avatar for nanchuangyeyu

Try to change your while loop to this: [CODE]while (in_file.read(reinterpret_cast<char*>(&i),sizeof(short))) { i_abs = abs(i); out_file.write(reinterpret_cast<char*>(&i_abs),sizeof(short)); }[/CODE]

Member Avatar for ArkM
0
133
Member Avatar for Usura

>>is it possible to return class A's struct in some function to class B? Yes >>do i need to overload this? and if so how would i write the overload function? No, you've to make class B a friend class of A

Member Avatar for r.stiltskin
0
100
Member Avatar for azamalvi
Re: help

[B][U]To remember for ever:[/U][/B] [COLOR="Red"][B][U]DaniWeb isn't a homework completion service[/U][/B][/COLOR], that means that we aren't writing this program for you, show us what you've already done so far, tell us where you get stuck and ask specific questions about the things you don't understand, all what you've done so far …

Member Avatar for tux4life
0
117
Member Avatar for losh177

[QUOTE=losh177;869592] Can i use the call cin.ignore('[B][COLOR="Red"]/[/COLOR][/B]n')? [/QUOTE] First of all it is [ICODE]cin.ignore('[COLOR="Green"][B]\[/B][/COLOR]n');[/ICODE] and secondly: read [URL="http://www.daniweb.com/forums/thread90228.html"]this[/URL] ...

Member Avatar for tux4life
0
164
Member Avatar for losh177

[LIST=1] [*]Is it only when you start your program in debugging mode that you're encountering this problem? [*]Is your program working correctly outside the debug-mode? [/LIST]

Member Avatar for losh177
0
2K
Member Avatar for ShadowScripter

Try to pass the following arguments to your compiler: [ICODE]/EHsc /link [I]YourLib[/I].lib[/ICODE] :) Edit:: Maybe [URL="http://msdn.microsoft.com/en-us/library/ms235630(VS.80).aspx"]this[/URL] is also helpful ...

Member Avatar for William Hemsworth
0
930
Member Avatar for JimstersNo1

> Is the PC really shutting down (powering off) and then restarting (a cold boot up) :?: >> If this is the case then it might be defined somewhere in your computer's BIOS, but probably this is just a Windows problem :) ...

Member Avatar for FlamingClaw
0
101
Member Avatar for shea279

[URL="http://www.truecrypt.org/"]TrueCrypt[/URL] is full-featured and comes with source code (but the code will be big I guess) :)

Member Avatar for ArkM
0
152
Member Avatar for miskeen

>Is there any special method in c++ called get and which doesn't require instantiation? >When i tried to find this method, I couldn't find it. Well I could find it: [URL="http://www.cplusplus.com/reference/iostream/istream/get/"]http://www.cplusplus.com/reference/iostream/istream/get/[/URL] :P Did you actually search? You can't just look over it, it's on top: [URL="http://www.lmgtfy.com/?q=c%2B%2B+get()"]http://www.lmgtfy.com/?q=c%2B%2B+get()[/URL]

Member Avatar for miskeen
0
95
Member Avatar for Deme

You'll have to use [ICODE]cin.ignore()[/ICODE] to clean the input buffer, read [URL="http://www.daniweb.com/forums/thread90228.html"]this[/URL] thread :)

Member Avatar for Deme
0
212
Member Avatar for Dilbert137

[QUOTE=Dilbert137;868121]It just that i do not find the source code for Clamwin. I am new to antivirus programming and want to understand more how it works and make a small program. I know want a source code is and have already written assembly codes.[/QUOTE] >...and want to make a small …

Member Avatar for tux4life
0
120
Member Avatar for omarzia88
Member Avatar for farag
0
144
Member Avatar for kenji

Why do you try to pass an [ICODE]fstream[/ICODE] object? Just declare an [ICODE]fstream[/ICODE] object in the private section of your class :)

Member Avatar for tux4life
0
100
Member Avatar for awais.abdul

Yeah, that's all OK, but can you post the code you have so far, and ask specific questions about what you don't understand ? Edit:: I think you're supposed to create a class hierarchy ...

Member Avatar for Salem
0
252
Member Avatar for 3beer

[ICODE]ofstream infile;[/ICODE] // create a new output stream [ICODE]infile.open ("[I]yourfile[/I]", fstream::app);[/ICODE] // open the file for appending

Member Avatar for 3beer
0
104
Member Avatar for handytxg

>Apart from that . The using of new operators and not deleting them is causing a memory leak everytime you run your code. Absolutely correct! But normally today's Operating Systems clean up the memory automatically when the program exits, however, allocating memory and not releasing it back is not a …

Member Avatar for tux4life
0
257
Member Avatar for Church

I would store the words in a plain text file and read them into a vector :)

Member Avatar for NeoKyrgyz
0
243
Member Avatar for Akis2000

So you have to estimate/calculate pi am I right? Could you please post the whole algorithm (+an example of the series)

Member Avatar for Akis2000
0
349
Member Avatar for Sky Diploma

[QUOTE=Sky Diploma;865973]What does CTRL+C do?[/QUOTE] [ICODE]CTRL+C[/ICODE] just breaks/stops the execution of a console program :) By the way: I had also expected your program was stripping comments from C/C++ source files, but you can easily adapt it to remove comments from files :)

Member Avatar for tux4life
0
329
Member Avatar for kaku_lala

That's the most ridiculous I've ever heard: using a [ICODE]float[/ICODE] to define a [ICODE]boolean[/ICODE] LOL :P [LIST=1] [*]It's harder to accomplish (but it isn't impossible :)) [*]A [ICODE]float[/ICODE] uses much more memory than a [ICODE]char[/ICODE] (and you don't need all this memory) [/LIST]

Member Avatar for Narue
0
186
Member Avatar for Akis2000

[QUOTE=Akis2000;865022]hello, i have a double value=0; and i want before starting the calulation to round this value in the numbers that the user add, for example 2... any ideas??? I have despered...........[/QUOTE] I don't understand that, can you give an example ?

Member Avatar for Akis2000
0
143
Member Avatar for NTxC

[QUOTE=NTxC;866022]Hello. I'm currently having a memory leak problem in my program (C++ with MFC, VS2005) and I don't know WHY it happens, as the code seems to be OK to me. Anyway, here's the code that causes memory leaks: [code=C++]char* va( char* FormatStr, ... ) { va_list ArgPtr; char *FinalString; …

Member Avatar for NTxC
0
447
Member Avatar for 7eatsnine

You can't declare functions within other functions/statements: [CODE]switch (menu) { case 0:{ [COLOR="Red"] void displayHigh ( int max)[/COLOR] [COLOR="Red"]{[/COLOR] double max = 0.0; for ( int numbers[i] = 1; i < 100; i++ ) if ( numbers[i] > max ) cout << "The Maximum number is: " << max; break; …

Member Avatar for 7eatsnine
0
159
Member Avatar for M'N'M

Just some advices (after a first quick look at your code, not a solution to your problem): [LIST] [*]In your main-function I encounter this line: [ICODE]while(flag==true)[/ICODE] it's just the long way to write: [ICODE]while(flag)[/ICODE] [*]I also encounter the nasty [ICODE]system("pause");[/ICODE] line, there's actually no need to use this, you could …

Member Avatar for tux4life
0
103
Member Avatar for newcook88

[QUOTE=Sky Diploma;865392][code] if (delim[b]=fileWord[b])[/code] Firstly Assignment "=" is not equal to Equal to "==". [/QUOTE] A little clarification: when you write [ICODE]if (delim[b]=fileWord[b])[/ICODE] then [U][B]you're assigning[/B][/U] the value at [ICODE]fileWord[b][/ICODE] to [ICODE]delim[b][/ICODE], as a result the assignment operator always returns the assigned value what means that if the assigned value …

Member Avatar for tux4life
0
600
Member Avatar for k007

I think you're already on a good way: you've already the skeleton of a class which will contain a flight's details ... [LIST] [*]Continue creating your Flight class [*]If your Flight class is ready, you could create a vector of it, that's a lot easier as you don't have to …

Member Avatar for k007
0
2K
Member Avatar for bernadlosini

Try something like this: [CODE]char filename[20]; if(argc>1) { strcpy(filename, argv[1]); }[/CODE] Edit:: We have to check whether the number of arguments is greater than 1 because the program's first argument ([ICODE]argv[0][/ICODE]) is always containing the program's filename ...

Member Avatar for tux4life
0
155
Member Avatar for teddycow

Why don't you just use the principle of reading and writing structures from/to a file? [B][U]To write to the file:[/U][/B] Let's say we want to write the following structure to a file: [CODE] struct book { char author[30]; char title[20]; char publisher[20]; int price; }; [/CODE] [CODE] const int NUM_OF_BOOKS …

Member Avatar for tux4life
0
105
Member Avatar for kiske

[QUOTE=kiske;865328]I've forgotten that in c++ the not operator is implemented with "~"[/QUOTE] Just a little bit extra info: In C++ you've actually two NOT-operators (this does also apply to the AND and OR operators): you've the bitwise NOT-operator [ICODE]~[/ICODE] and you also have the logical NOT-operator [ICODE]![/ICODE] :) ... You …

Member Avatar for ArkM
0
244
Member Avatar for sabian4k

Divide the problem into parts: [LIST=1] [*] Declare an array (of type [ICODE]char[/ICODE])where you want to put all those digits in [*] Get the integer from the user (get it via [ICODE]cin[/ICODE] and store it in an integer variable) [*] Use the [ICODE]itoa[/ICODE] function to convert the integer to a …

Member Avatar for tux4life
0
93
Member Avatar for l3vi

>This may help Yeah, Alex, it will surely help him, but you don't explain him what you've changed to make his code work ... To the OP: It's because of the [ICODE]getline[/ICODE] function, so you'll have to flush the input stream each time to make your code work as expected, …

Member Avatar for l3vi
1
1K
Member Avatar for hammans

That's the worst main function I've ever seen: [ICODE]void main()[/ICODE] ([URL="http://www.gidnetwork.com/b-66.html"]reason[/URL]) Please post using code tags, and by the way: I don't see any question, I'm not a magician, I cannot look into your mind to see what your problem is, so please just tell it :P

Member Avatar for MosaicFuneral
0
120
Member Avatar for nishantsharma

[QUOTE=William Hemsworth;863484][CODE=CPLUSPLUS]#include <iostream> int bin_to_int(char *binary) { // ... } double bin_to_double(char *binary_fixed_point) { // ... } int main() { // ... }[/CODE]Hope this helps.[/QUOTE] You forgot to put the [ICODE]using namespace std; [/ICODE] instruction in your snippet :P

Member Avatar for tux4life
0
241
Member Avatar for OffbeatPatriot

[ICODE]__WXMSW__[/ICODE] ... Don't you've to build them for Unix/Linux? As you can run your applications in X :) I think you don't need the Windows Version of wxWidgets, but the wxX11-version (you can [URL="http://www.wxwidgets.org/downloads/"]grab it[/URL] from their site) ...

Member Avatar for tux4life
0
379
Member Avatar for asweetroxxi

[QUOTE=asweetroxxi;864156]i put my whole program in the thread[/QUOTE] I've nothing against the fact you're putting your whole program in this thread, as long as you use code tags !

Member Avatar for tux4life
0
105
Member Avatar for sabian4k

I already wrote something like this for BigInteger addition (using C++ strings), maybe it might help you: [URL="http://www.daniweb.com/code/showsnippet.php?codeid=1154"]http://www.daniweb.com/code/showsnippet.php?codeid=1154[/URL] :) By the way, you haven't ask us a specific question, where are you having problems with in your code?

Member Avatar for tux4life
0
175
Member Avatar for BlackStar

[QUOTE=William Hemsworth;852489][ICODE]bool[/ICODE], not [ICODE]void[/ICODE] and there isn't really any need to reference the parameters either.[/QUOTE] And if you're referencing parameters and you aren't changing the parameters passed by reference it's better to pass them as a constant reference :) ... To the OP: You forgot several brackets in your code …

Member Avatar for BlackStar
0
229
Member Avatar for smyth9957214249

>PLS REPLY You've two replies, are you happy now? Don't just copy your homework assignment :(

Member Avatar for tux4life
0
62
Member Avatar for valtikz

[QUOTE=valtikz;862994] [code]void PhoneBookModel::sortByName( Glib::RefPtr<Gtk::TreeSelection> selection ){ /* Enter SortByName Function here */ }[/code] [/QUOTE]>Enter SortByName Function here I hope this wasn't a request to do your homework, you'll never get free code here, you've to get your grade by turning in your code, not by turning in the code we …

Member Avatar for Nick Evan
0
89
Member Avatar for BlackStar

The first is not good, and the second is also a bad one: [ICODE]Head = NULL;[/ICODE] Why should you set the pointer to NULL right after the declaration? It's automatically done (If you declare a pointer, it's automatically pointed to the first memory address: NULL) ...

Member Avatar for BlackStar
0
414
Member Avatar for tux4life

[QUOTE=Ancient Dragon;862638]That is incorrect. The pointer is assigned whatever random value is at that memory location. For example [icode]char *ptr;[/icode] the address of ptr is whatever is at that memory location on the stack (assuming its not a global variable). It is never auto set to NULL by the compiler …

Member Avatar for Ancient Dragon
0
217
Member Avatar for gryft

[ICODE]while(!fin.eof())[/ICODE], before testing for EOF you should have performed at least one read operation (read [URL="http://www.gidnetwork.com/b-58.html"]this[/URL]), so this would be a correct way to do it: [CODE] [B]getline(fin, s);[/B] while(!fin.eof()) { getline(fin, s); cout << found << endl; } [/CODE]

Member Avatar for tux4life
0
165
Member Avatar for pikkas

Actually there's already such a feature in the C-subset of C++: [URL="http://www.cplusplus.com/reference/clibrary/ctime/clock/"]http://www.cplusplus.com/reference/clibrary/ctime/clock/[/URL] :P

Member Avatar for tux4life
0
109
Member Avatar for booker

Please be more specific in your question: [ICODE]Does anyone of you know how to protect this?[/ICODE] Do you want to add a copy protection to your program?

Member Avatar for tux4life
0
135

The End.