15,300 Posted Topics

Member Avatar for ShadowScripter

you are close [code] #include <iostream> #include <string> #include <cstring> using namespace std; class MyClass{ public: MyClass Foo(); MyClass Bar(); MyClass Pancakes(string ingredients); }; MyClass MyClass::Foo(){ cout<<"Inside foo\n"; return *this; } MyClass MyClass::Bar(){ cout<<"Inside bar\n"; return *this; } MyClass MyClass::Pancakes(string ingredients){ cout<<"To make pancakes you need: " << ingredients << …

Member Avatar for ShadowScripter
0
100
Member Avatar for jupkw

what version of windows is running on your computer? If you have Vista then I'm not supprised that tc won't run. Get yourself a newer free compiler, such as Microsoft VC++ 2008 Express or Code::Blocks.

Member Avatar for vj4u99
0
256
Member Avatar for FlamingClaw

Everyone gets bad rep from time-to-time, don't worry about it. Feel lucky I didn't give that bad rep because it would have cost you 23 points instead of the 4 points Killer_Typo gave you.

Member Avatar for FlamingClaw
0
114
Member Avatar for ShadowScripter

>>Anyone know why this doesn't work? Because the vector is destroyed when function testor() returns to its caller. A better way is to pass the vector by reference to testor() [code] void testor(vector<string>& v) { v.push_back("Lolzer"); } int main() { vector<string> v; testor(v); } [/code]

Member Avatar for ShadowScripter
0
94
Member Avatar for kylcrow

why are you trying to dynamically allocate that array? Just hard-code it [icode]bool visited[11][55];[/icode] then delete lines 4 and 11. If it must be dynamically allocated, then you will have to do it like this: [code] visited = new bool*[11]; for(int i = 0; i < 11; i++) visited[i] = …

Member Avatar for Ancient Dragon
0
101
Member Avatar for Liszt

you [URL="http://www.daniweb.com/forums/showthread.php?t=121245&highlight=icon"]mean this?[/URL]

Member Avatar for Ancient Dragon
0
91
Member Avatar for dev565

[QUOTE=dev565;870001] 1) What if my line is over 1024 chars????????? how should I fix my code to handle that situstion[/quote] If you want to read the entire line at one time then just declare the input character array to be large enough to hold the largest possible line. >>If there …

Member Avatar for Ancient Dragon
0
942
Member Avatar for deepglue555

>>everytime pin or checks is not a null string it throws a GPF. >>checks and pin are strings Do you mean std::string declared in <string> header file? Those are not null-terminated strings at all but c++ class. Post the function prototype for [icode]whitelist(checks, pin, wkbool, wqbool, enpassant)[/icode]

Member Avatar for deepglue555
0
266
Member Avatar for Stefano Mtangoo

It doesn't compile with VC++ 2008 Express either. The compiler didn't like the preprocessor directive on line 1002, chkconf.h. So I changed it to this: [code] #ifdef wxUSE_CRASHREPORT #if !wxUSE_ON_FATAL_EXCEPTION # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CRASHREPORT requires wxUSE_ON_FATAL_EXCEPTION" # else # undef wxUSE_CRASHREPORT # define wxUSE_CRASHREPORT 0 # endif #endif …

Member Avatar for Stefano Mtangoo
0
170
Member Avatar for Liszt

[QUOTE=_Nestor;869364]as you can have more than one NIC and it is more likely to be changed than your hard drive[/QUOTE] Computers can also have multiple hard drives. And I've changed hard drives more frequently than NICs. Possibly there is some unique ID in the bios that can be retrieved, I …

Member Avatar for Liszt
0
240
Member Avatar for bunnyboy

lines 36 and 37: delete these lines because they are just a temp pointers and can not be deleted.

Member Avatar for bunnyboy
0
112
Member Avatar for Aamit

You need two sets of loops. The first loop will only display the values of the array. [code] for (i=0;i<count;i++) { printf("%d\n",arr[i]); } [/code] Then you need another set of loops, similar to the one you already posted, but just prints [icode] printf("%d + %d\n",arr[i],arr[j]);[/icode] >>but when my array having …

Member Avatar for siddhant3s
0
502
Member Avatar for power_computer

[QUOTE=power_computer;869708] How do i open the file?[/QUOTE] [icode]inFile.open(str);[/icode] Note that scanf() will not allow spaces in the text, so if the filename and/or path contains spaces then you need to use getline() instead of scanf().

Member Avatar for Salem
0
3K
Member Avatar for nanchuangyeyu

[QUOTE=tux4life;869778]BTW, Why is there actually need for the file being opened in binary mode? Why don't you just use the text mode ?[/QUOTE] Because the file apparently contains the binary (or computer internal storage) values of the data, which are not human-readable and not text. Such files can not be …

Member Avatar for ArkM
0
133
Member Avatar for hawash

>>I want it to work can anyone help me Probably not. Attach it to your thread here so people can easily download it. Just hit the Go Advanced button, then the Manage Attachments button.

Member Avatar for hawash
0
108
Member Avatar for losh177

use the new operator to allocate dynamic memory [icode] Holding *holdLib = new Holding[size];[/icode]

Member Avatar for losh177
0
123
Member Avatar for QuintellaRosa

>>But I need to know what are the best practices for code sharing, like: For every 1,000 programmers there are 1,000 coding styles! Every coder develops his/her own coding style or use the coding style standard set by the company. A good place to start is the links that siddhant …

Member Avatar for Ancient Dragon
0
80
Member Avatar for tim o'neil

what operating system? More than likely someone changed the password without your knowledge.

Member Avatar for Ancient Dragon
0
31
Member Avatar for 215wrestler189

Is that a MS-Windows GUI program? If it is, then you need to add a message pump in the loop so that Windows has a chance to update the window. I would put it inside that wait function.

Member Avatar for Ancient Dragon
0
91
Member Avatar for gretty

probably the easiest way is to sort both arrays then all you have to do is check then from top to bottom, if any of the elements in array A are not the same as the corresponding element in array B then they are different.

Member Avatar for siddhant3s
0
4K
Member Avatar for Project_Panda

std::vector is not a difficult class to use [code] class Person { // blabla }; vector<Person> theList; // add a person to the list Person p; // fill out the structure is not shown here theList.push_back(p); // add to the list // after that you can use the vector just …

Member Avatar for ithelp
0
116
Member Avatar for hydravien

Sounds like you need to post in Job Offers -- someone might help you if you want to pay $$$ for their work.

Member Avatar for nexocentric
0
193
Member Avatar for vikaschndr

Does the service program have permissions to do that? You might have to have the service log in with an administrator account.

Member Avatar for vikaschndr
0
168
Member Avatar for Liszt

I see no reason why that compiler could not support Secure FTP -- FTP is not part of the C or C++ languages, so you would have to get the code in the form of a 3d party library. I have not done it myself, so I would be little …

Member Avatar for Ancient Dragon
0
124
Member Avatar for Rama_Kamisetty

[QUOTE=Rama_Kamisetty;864829]Thanks for the reply i will be using the same thanks a lot[/QUOTE] His code isn't correct solution to your problem, but does give you a good start on it.

Member Avatar for ramyasowbhagya
0
93
Member Avatar for Ancient Dragon

The post count on the forum's main menu is incorrect. For example the thread circled in the attached bitmap says 0, but there are three responses to the original post

0
55
Member Avatar for smthdeedog48

[QUOTE=smthdeedog48;865425]No i don't need help all the time! I just thought some one that has been in this predicament before knows how i feel and would like to help and not make fun of is it a crime to ask for help! I am an Electrician I bet if i …

Member Avatar for Ancient Dragon
0
322
Member Avatar for HunterFish

you mean so that the result looks like this? [quote] 0000000000 1654 </contact> </desc> </desc> </desc> </desc> </name> </name> </phonebook> </pop> </pop> </pop> </pop> </uri> </uri> </uri> </uri> <contact> <desc> <desc> <desc> <desc> <name> <name> <phonebook> <pop> <pop> <pop> <pop> <uri> <uri> <uri> <uri> Contact Example Laptop Phone a l.jl …

Member Avatar for HunterFish
0
202
Member Avatar for DotnetRaji
Member Avatar for Sky Diploma

Oh, so all it does is strip comments from keyboard input and not from a *.c or *.cpp data file??? Why would you want to write such a program? >>I mean this program exits when "x" is inputted. Is there any other way of Exiting? Just press Ctrl+C.

Member Avatar for tux4life
0
329
Member Avatar for jephthah

not only does [noparse][code=cplusplus][/noparse] give syntax highliting but also line numbers. So are you suggesting [noparse][code][/noparse] also provide line numbers?

Member Avatar for FlamingClaw
2
218
Member Avatar for jephthah

[QUOTE=jephthah;863288]i'm just wondering, "where's the love?"[/QUOTE] You must not be married -- if you had you would understand that married couples often squabble, but they still love each other. Besides, bitching is the whole purpose of this forum :)

Member Avatar for jephthah
0
108
Member Avatar for Rajesh1978
Re: IPC

IPC isn't really all that difficult -- yes you can learn it on your own. *nix IPCs work differently than MS-Windows, and presumably other operating systems too. IPC could be as simple as file sharing, or as difficult as sockets, pipes and shared memory. There are a lot of different …

Member Avatar for Ancient Dragon
0
121
Member Avatar for abletable

[URL="http://www.youtube.com/watch?v=glNjsOHiBYs"]Happy Birthday[/URL] -- and welcome to the Old Fart's Club :)

Member Avatar for Dani
0
31
Member Avatar for namehere05

The problem is scoping -- object A goes out of scope before the cout statement on line 31. Delete the { and } on lines 20 and 29 and your program will work as you expect it to.

Member Avatar for VernonDozier
0
138
Member Avatar for Ancient Dragon

Just thought I'd let you know why misspelled words are not caught while you type today.

Member Avatar for MidiMagic
1
94
Member Avatar for Adexter

Highest() returns the wrong value -- it should return the index value (value of i loop counter) of the student with the highest grade. You will need to add another variable to keep track of that too. There are a couple ways to implement those functions: 1) in main(), first …

Member Avatar for Ancient Dragon
0
146
Member Avatar for NTxC

memory is allocated on line 10 but never deleted. Try this: [code] void CMFC1Dlg::OnBnClickedButton1() { char *ptr; if( m_POpened ) { CString cmd; m_EditCmd.GetWindowTextA( cmd ); ptr = va( "%s%c", cmd, 13 ); m_Port.WriteToPort( ptr); delete[] ptr; } } [/code]

Member Avatar for NTxC
0
447
Member Avatar for massivefermion

Stop your begging and read your text book. Also paying attention in class would help.

Member Avatar for Ancient Dragon
0
151
Member Avatar for smthdeedog48

moved -- this thread is not an Introduction, like "Howdy folks, my name is Darrel and I'm happy to be here!". Nope. This thread seems to be a bitching session.

Member Avatar for Ancient Dragon
0
163
Member Avatar for waphon
Member Avatar for BlackStar

You have to start at the beginning of the linked list and search for the node you want -- somethng llike this: [code] struct* node = head; while(node->next) { // check if this is the node you want // // now advance to the next node node = node->next; } …

Member Avatar for BlackStar
0
505
Member Avatar for mostermand

something like this: [code] void foo( int x = 0) { switch( x ) { case 0: printf("case 0\n"); break; case 1: printf("case 1\n"); break; default: printf("default\n"); break; } } int main() { foo(); foo(1); } [/code]

Member Avatar for mostermand
0
149
Member Avatar for bernadlosini

when you type the filename on the command line that name (assuming it has no spaces) is contained in argv[1] [code] int main( int argc, char* argv[]) { if( argc > 1) cout << "The file name is: " << argv[1] << "\n"; } [/code]

Member Avatar for tux4life
0
155
Member Avatar for Ancient Dragon

usine FF on Vista, code inside code tags without line numbers turn is not visible when I click the Toggle link. Works ok with [noparse][code=cplusplus][/noparse]. The problem only happens on random posts. [URL="http://www.daniweb.com/forums/post858782.html#post858782"]Here[/URL] is an example I extracted from another post (PM) When I edit the code tags to add …

Member Avatar for Dani
0
226
Member Avatar for bernadlosini

The requirement for CREATE TABLE indicates that the table contents should be read from a text file (aka schema), not hard-coded in your program. One common way to do that is to create a structure that contains the information for each field in the table [code] struct field { std::string …

Member Avatar for bernadlosini
0
2K
Member Avatar for dzoch89

where did you declare array [b]item[/b]? Change the while statement to [icode]while( i < sizeof(item)/sizeof(item[0]) && fscanf(...) > 0)[/icode]. Note: if [b]item[/b] array is a paremeter to the function you posted then that sizeof() stuff will not work.

Member Avatar for dzoch89
0
131
Member Avatar for wakeboarder1335

On the client side, create a string that contains all the values separated by a space. Then send that string to the server. On server side, convert the string to individual data values, make the computations, then create a string with the result value and send back to the client.

Member Avatar for Ancient Dragon
0
117
Member Avatar for Shyam14

Welcome to DaniWeb. Be sure to [URL="http://www.daniweb.com/forums/forum52.html"]post your resume here[/URL] to get more exposure.

Member Avatar for Ancient Dragon
0
101
Member Avatar for hi.meral

Welcome to DaniWeb. >>But still I am confused for .net. What should i do? Study. Practice. Poast in the C# forum.

Member Avatar for Ancient Dragon
0
71

The End.