420 Posted Topics
Re: [QUOTE][CODE=CPP] case 2: di.getmeaning(word);//problem passing arguments [/CODE][/QUOTE] Here, you haven't asked the user to type in a word, so your string will be blank | |
Re: You'll need to explore a graphical API to create the GUI - this will depend what platform you're running (Or you could explore a cross-platform API such as wxWidgets [url]http://www.wxwidgets.org/[/url] ) | |
Re: MingW is a popular windows compiler (for C and C++) - a windows port of the linux GCC tools. have a look here [url]http://www.mingw.org/[/url] I have no idea whether it supports any of the GTK libraries you're using, you will most likely need to google around for windows versions of … | |
Re: [QUOTE=TkTkorrovi;423368]Would be much more time effective if you would abandon this IDE.[/QUOTE] I think he has already abandoned the old, outdated "turbo C" from the early 1990s, and is now using the modern, standards-compliant 'Turbo C++ explorer' ... There's nothing (that i'm aware of) which is wrong with this newer … ![]() | |
Re: I assume [i]the main function[/i] is that one called [i]main()[/i] - which is the entry point of your program If a variable is global, that means its declared outside of any functions. (the terms "local" and "global" refer to where in your program that variable is declared. the syntax for … | |
Re: Why have you created your own isspace function? You'd be better off using the one declared in <cctype> | |
Re: Of course some professionals use goto's [u]occasionally[/u] ... with reference to the linux kernel, here's Linus Torvalds' take on goto [url]http://kerneltrap.org/node/553/2131[/url] Although I would put goto's in the same league as Macros, Unions, Multiple Inheritance, reinterpret_cast, placement new .... in other words - all things which you should generally avoid … | |
Re: [QUOTE=qaiser;423265]please write the programming code of this reverse contents of array in c++[/QUOTE] Please read this link [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: [QUOTE=Hamrick;423272]There might be a way in the STL to do it, but I don't know. I'd write a search function that finds every occurrence of "is" and then checks to see if the first and last letters are on a word boundary.[/QUOTE] Yep, the STL is handy here, although your … | |
Re: [QUOTE=elle_yuyu;422713]i dont know how to write this code..anyone can help me ?? here are the question : Write a complete program that calculates the wages of an employee for the month(hint : input from user includes year,month,time in/time out for each day in that month.). monday-friday :first 8hrs,Rm50......add.hour RM10/hr. saturday … | |
Re: If by 'bridging' you're referring to [URL="http://practicallynetworked.com/sharing/"]Internet Connection Sharing (ICS)[/URL], then click that link for some guides on how to use the ICS which comes with Windows. (What ICS actually does is turn the computer into a router.. although its most popular application is for sharing an internet connection) Could … | |
Re: you don't need to take value_type out, just make sure the name is fully qualified when using it outside of the class, ie, [CODE][b]node::[/b]value_type node::get_data() const[/CODE] | |
Re: [QUOTE=toko;420490]Hello, i have been reading the chapter in the book about classes and i have learned everything about them the only question i have now is that wut do you use classes for?[/QUOTE] Have you ever used the [b]struct[/b] keyword to create your own simple type combining several variables together? … | |
Re: [QUOTE=AdventChildren0;418473]nvm the errors cleared but the problem is it gives out 32 outputs. (your code) I assume 1-26 = A-Z but what is the other 6? [/QUOTE] The output should have been the characters 'A' to 'Z' in octal, 101-132 (that's 26 numbers, not 32). What output did you get? … | |
Re: [QUOTE=Salem;416832]To me, it's just another socially unacceptable habit (like smoking). Once widely practised, it is now banned in many places. [/QUOTE] Seems like a fairly blunt view of religion you've got there :) I don't see religion as a problem in itself (We all have to believe [i]something[/i], right?) Afterall, … | |
Re: [QUOTE=dev.cplusplus;417820]Hi to all, I hope uyou can help with the following situation i have: I have to write a function that receives a parameter, that is unknow until runtime, meaning one of the parameters could be: CString, int, double, bool or something else The function receive additional parameters that are … | |
Re: [QUOTE=Salem;418108]2. You use a pointer, THEN later on test it for NULL [/QUOTE] [QUOTE=Arctic wolf;418125]2. Why is it wrong?[/QUOTE] NULL means that the pointer doesn't point to anything, so using a pointer and testing it for NULL afterwards is an entirely backwards way of doing things. Consider this scenario at … | |
I wonder if anyone has seen this before - a programming 'language' aimed at young children. Of course, not really a programming language in the usual sense, and certainly not going to produce the next Quake game, but a great idea to introduce people to the basic ideas of programming … | |
Re: [QUOTE=Geometroid;417549]Hello, I'm new to the site here. I say this because there seems to be a fair bit of etiquette here that I could step on so if I do, that's why. [/QUOTE]Welcome to DaniWeb! :) I reccomend reading the threads at the top of the forum marked [b]Announcement[/b] and … | |
Re: woo! right up my street! :D i got 70% .. I guess ALF was an american thing? And i didn't even know the pacman ghosts had names ;) ... also, who's Punky Brewster? The rest are obvious :D | |
Re: 25/50 ... although i took random guesses at a third of the questions. :) [QUOTE=MidiMagic;417374]This test is not a matter of truth, but of what liberals believe is the truth.[/QUOTE] Most of it has nothing to do with politics. They're all based on statistics and quotations as reported in the … | |
Re: You don't need to create the entire weapon class inside the player class, (at the moment it seems to be inside the armour class for some reason. This seems to imply that a weapon is an implementation detail of armour. If you don't want this, you can make it stand-alone). … | |
Re: This isn't C++ code, its C. (The two languages are very different) Probably the reason that you get an error when your code exits, is that your declaration of main() is ill-formed. Change your main declaration so that it looks like this - [CODE=C]int main(void) [/CODE] As for your issue … | |
Re: The best suggestion I can offer is to download a few and try them, see which you like the best. choice of IDE is a personal preference, and shouldn't affect the kinds of programs you can create when you're just starting out with the standard language. in addition to Turbo … | |
Re: As Ancient Dragon said, there's always something you can learn to improve yourself For example, another language, different ways of using the language(s) you currently know, design patterns, different libraries/APIs, problem analysis/design, algorithmics, learning other paradigms, machine code.. the list goes on. | |
Re: [QUOTE=toddn149;409914]I have DSL, and was told that there is no speed loss when using a router for up to 4 pc connections. This seems to be confirmed when downloading from one site and surfing the net on my laptop, I do not notice any speed changes. So, on to my … | |
Re: [CODE]void BankAccount::check_input(int dollar,int cent,double rate) { if ((dollar<0)||(cent<0)||(rate<0)) cout<<"Illigal values !!!"; [COLOR="red"][B] exit(1);[/B][/COLOR] } [/CODE]Look at this line, and where it is. (Ignore indentation) what happens in this function? | |
Re: First, look carefully at the compiler errors, and correct spelling/typing mistakes (I see at least one!) Second, where is your struct definition..? (Perhaps you need to read up on how to create a struct) ![]() | |
Re: That depends - Do you have an example you can post of the code where you're reading input from the user? ![]() | |
Re: [QUOTE=seacraft;413339]Yes I want to share printer and be able to simply move data/doc/pic files between the two PCs. Sharing is enabled on both PCs but I can only get access to wifes PC while mine is 'inaccessible'. Using 'Find computer' I can see my PC from her side but cannot … | |
Re: First thing I suggest doing, is looking at this bit of your program carefully [CODE=CPP]enum SquareState { (blank = 's', X = 'X', 0 ='0') }; [/CODE]If you can't spot the errors, do some reading about enums | |
Re: Integers are only capable of representing whole numbers. Have a look what happens when you do this (Remember that both 3 and 100 are integers) [CODE=CPP] cout << 3/100 ; [/CODE] change your variables from type int to type [I]double[/I], and change your [inlinecode]3/100[/inlinecode] to double's - ie, [inlinecode]3.0 / … | |
Re: Have a look at Beej's guide to network programming. Its geared towards linux, but much of it applies to windows programming too [url]http://beej.us/guide/bgnet/[/url] | |
Re: [QUOTE=Arctic wolf;413753]Hello Salem, I know that rand() is a pseudorandom. You probably missed this part of my program: [code] void randomize () { srand((unsigned)time(NULL)); } . . . . randomize(); [/code] as you see I seed the generator with current time,therfore the generator should start with a different number every … | |
Re: What do you understand by the assignment you've been given? Have you attempted any of it yet? | |
Re: [QUOTE=khalidxa;412982]I have been trying to return a two dimensional array in a function but it is getting me no where, please tell me how to do it. the code is as follow : [CODE] int *population();[/CODE] [CODE]int *testCase::population() { for(int i=0;i<3;i++) { for(int j=0;j<2;j++){ matrix[i][j]=rand()%2; } } return matrix[0][0]; }[/CODE] … | |
Re: The problem would appear to be that you're not sorting your entire list, only half of it. look in the loop here [CODE] for (int i = 0; i <l; i++) { big = x[0]; for (int j = 0; j <l; j++) { if (x[j] > big) { big … | |
Re: yes, reading all your input as a string is one reliable way to do it (That would be my preference). The other reliable way is to use cin as an 'if' or 'while' condition. (Not so great, because you have to deal directly with the cin error flags every time) … | |
Re: [QUOTE=mooncry;412975] 1. Where can i find a ISO 10646\ Universal character names Code charts ? [/QUOTE] If you're on Windows, you could use the windows character map. Make sure that you select the font which matches that of your output window. | |
Re: er, so, what was the question? | |
Re: [QUOTE=vijayan121;412041]completely incorrect. the current version of turbo c++ (the free version is now called 'Turbo C++ Explorer') does support standard ANSI C and ISO/IEC C++ languages and libaries.[/QUOTE]From what i've seen, the chance is, anyone posting here claiming to use "turbo C", is most probably referring to the original Borland … | |
Re: [QUOTE=bops;411254]Posting the errors your get when you try to compile the code would help. [code] // A tip: you don't need to write using std::cin; using std::cout; // If you have.. using namespace std; // Because std::cin and std::cout are all part of the std namespace, so that one line … | |
Re: Perhaps, while you're learning, it would be a good idea to leave all the windows stuff alone. at least until you've got a firm grip on the basic language. There's alot less that can go wrong when you're just dealing with C++ on its own. | |
Re: [QUOTE=Ancient Dragon;409373]which line ? On line 18 the value of ptr2 is random because it is uninitialized. Line 22 is also random because it is deferencing the integer located at the address of the address, which also has not been initialized and could possibly crash the program. I don't know … | |
Re: Narue has written an excellent (but somewhat lengthy) article about pointers If you care to learn more about pointers its well worth the read [url]http://www.eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx[/url] [I]edit[/I]: Another good article, from DaWei, can be found here [url]http://daweidesigns.netfirms.com/cgi-bin/pointers.php[/url] | |
Re: it would appear that you're using the wrong kind of single-quote mark (Some character sets have several different ones). you should be using ' ' rather than ` ` (did you copy the code out of a word document or powerpoint presentation?) Ancient Dragon's solution is the easiest (You'll have … | |
Re: have a look at these links here - [url]http://users.aber.ac.uk/auj/voidmain.shtml[/url] [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376[/url] [url]http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.3[/url] | |
Re: [QUOTE=harshbhatt88;408444]I dont know what to do in further program. Please make me the rest of the code. Thanks in advace[/QUOTE] 1) Don't be so lazy, read here [url]http://www.daniweb.com/forums/announcement8-2.html[/url] 2) This is a 'C' program. you're in the C++ forum. | |
Re: [QUOTE=quintoncoert;401584]@ narue unless of course someone else knows exactly what she means.[/QUOTE] I expect the reason is that C is still the most widely used general purpose programming language. It doesn't really matter what features are available in C++/Java/etc when an existing system is written in C - many jobs … | |
Re: [QUOTE=Ancient Dragon;408007]Sorry, but the two are not interchangeable. [b]int space [] [/b] causes illegal syntax error message (VC++ 2005 Express compiler.). Unless that is something new in C99 standards, which very few compilers support yet.[/QUOTE] Hmm, I just tried that on Comeau in strict C90 mode (Comeau tends to be … |
The End.