1,171 Posted Topics
Re: Well, normally if you want to make sure that your program is platform independent, [URL="http://pdcurses.sourceforge.net/"]pdcurses[/URL] is often used for that :) | |
Re: Why not using a [B]stringstream[/B] ? [CODE=CPLUSPLUS] unsigned char arr[] = "4564"; unsigned int val = 0; stringstream ss; ss << arr; // write the array to the stringstream val = ss.get() - '0'; // get next digit and store it in 'val' [/CODE] This is only an example, you'll … | |
Re: [B]>but i dont know how to do it[/B] How do you know? Have you already tried it? If not so, please do so, according to [URL="http://www.daniweb.com/forums/announcement8-2.html"]Daniweb's homework policy[/URL] you should first show your own effort :) Start with this: [CODE=CPLUSPLUS] #include <iostream> using namespace std; int main() { } [/CODE] | |
Re: Define 'LARGE', 1GB, 2GB, 10GB, 100GB ?? If it's for example 4GB, then you already need a computer with bunches of RAM, to read the whole file into a character array :P As already mentioned: The buffer technique is the solution for this, try it out :) When you've put … | |
Re: [QUOTE=lotrsimp12345;898195]nvm. going to ask teacher.[/QUOTE] Are you implying that your teacher knows more than everyone together, here on Daniweb? :P | |
Re: Please don't use [ICODE]system("pause")[/ICODE]... Use [ICODE]cin.get();[/ICODE] instead. ([URL="http://www.gidnetwork.com/b-61.html"]explanation[/URL]) BTW, why are you including [B]windows.h[/B] ([ICODE]#include <windows.h>[/ICODE])? You aren't using anything of it. :) | |
Re: [QUOTE=Tom Gunn;898070]A moderator hasn't told me that I've done anything wrong yet. Besides, the announcements are specific about homework without showing any effort. That's not the case here. The "Read this first!" even says that giving away answers is subjective. If you want me to change how I post, you … | |
Re: [QUOTE=eliza2044;898253]I will keep that in mind thanks!!! :)[/QUOTE] No, don't do it, what he says is wrong... | |
Re: Noooo! Not [ICODE]system("pause")[/ICODE] again :( I get tired of saying it: use [ICODE]cin.get();[/ICODE] instead :) ([URL="http://www.gidnetwork.com/b-61.html"]explanation[/URL]) | |
Re: [URL="http://msdn.microsoft.com/en-us/beginner/cc305129.aspx"]This ebook[/URL] is the most suitable for you I think, superb explanations, cool code examples, answers to most of your C++ questions... :) | |
Re: [B]>ya ur right i shouldn't have given him the code.What shall i do now?[/B] Just [URL="http://www.daniweb.com/forums/thread78223.html"]read the forum rules[/URL] and make sure that it doesn't happen again :) | |
Re: First, read [URL="http://siddhant3s.googlepages.com/how_to_tell_rusted_cpp.html"]this[/URL] excellent info and migrate your code to be more standard :) (Especially read [B]2.3[/B], and when you've some time left, than it might be a good idea to read the whole guide) | |
Re: Did you already notice the [URL="http://www.daniweb.com/forums/thread70096.html"]sticky thread[/URL] about C++ books at the top of the forum :P ?? However: [URL="http://msdn.microsoft.com/en-us/beginner/cc305129.aspx"]here's[/URL] a good one, free and in PDF (it's an ebook) :) | |
Re: [QUOTE=VernonDozier;896250]You don't need to put this line: [code] using namespace std; [/code] Rename your class to something besides [ICODE]std [/ICODE]and the error will go away. [/QUOTE] Here's my solution (just a simple example): [CODE=CPLUSPLUS] #include <iostream> using namespace std; class std { enum {A = 1, B, C}; public: std::std() … | |
Re: [QUOTE=Reedz;896257]thanks the task is done. thank you all for your cooperation.[/QUOTE] Wow, and that after a year :P | |
Re: [QUOTE=wildgoose;893074]You'r entering goals as strings but you aren't comparing the integer values of those strings.[/QUOTE] [B][U]Conclusion:[/U][/B] If you want to store numeric values it's better to use numeric datatypes as well, and not strings, in this case an integer would fit the best, you declare an integer like this: [B][ICODE]int … | |
Re: [B][U]First some remarks on your code:[/U][/B] [LIST] [*][B]Where are you using these libraries in your code?[/B] [CODE=CPLUSPLUS] #include <windows.h> #include <cstdlib> // for system("pause"); junk #include <conio.h> #include <stdio.h> #include <sstream> [/CODE] [*][B]BTW, instead of creating a variable for each field, like this:[/B] [CODE=CPLUSPLUS] char Csquare1('1'); char Csquare2('2'); char Csquare3('3'); … | |
Re: [B]>Can any one help me!?[/B] Yes, where are you having problems with? BTW, Could you post your own try as well ? | |
Re: [QUOTE=Luigibosko;894465] The error I get is "`bitset' does not name a type ". Could someone please help me out with this? [/QUOTE] I think you've forgot something, check out [URL="http://msdn.microsoft.com/en-us/library/zfae7kt8(VS.80).aspx"]this[/URL] :) (You forgot specifying the number of bits) | |
Re: [B]>I'm gonna guess TurboC running on top of XP just for the hell of it.[/B] Trust me, he is :) [U]To the OP:[/U] If you really need conio, go and get a decent compiler like MinGW and use [URL="http://conio.sourceforge.net/"]this[/URL] conio implementation for it :) That would already be a lot … | |
Re: It would be more correct to say that switch case only works for integer constants :P To the OP: [URL="http://www.daniweb.com/forums/thread78223.html"]Read this before posting![/URL] | |
Re: It's better to [B][B]avoid[/B] using [ICODE]system("pause");[/ICODE][/B] Use [ICODE]cin.get();[/ICODE] as a replacement of [ICODE]system("pause");[/ICODE], less typing and more portable :) !! Check out [URL="http://www.gidnetwork.com/b-61.html"]this[/URL] if you want to know why :) | |
Re: And so far nobody has told you that it's better to [B][B]avoid[/B] using [ICODE]system("pause");[/ICODE][/B] Use [ICODE]cin.get();[/ICODE] as a replacement of [ICODE]system("pause");[/ICODE], less typing and more portable :) !! Check out [URL="http://www.gidnetwork.com/b-61.html"]this[/URL] if you want to know why :) | |
Re: [B]>please help me ?[/B] If you post using [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL]. [B]>tell me why code is not work correctly ?[/B] Analyzing code without code tags goes far beyond my skills... If you'd followed the steps described [URL="http://cboard.cprogramming.com/c-programming/88495-development-process.html"]here[/URL] while developing your program, your program should work fine now, but apparently you didn't … | |
Re: Would you mind reading [URL="http://www.daniweb.com/forums/thread78223.html"]this[/URL] and use code tags ? Edit:: And something else: migrate your code to standard C++ code ([U]don't use[/U] [ICODE][B]void main[/B][/ICODE] for example), review [URL="http://siddhant3s.googlepages.com/how_to_tell_rusted_cpp.html"]this web page[/URL] [B][U]carefully[/U][/B] :) Edit:: Tom Gunn's (one post below, #3) is right in saying that it will check for all … | |
Re: [QUOTE=WaltP;894462]See [url=http://www.gidnetwork.com/b-38.html]this for formatting help[/url][/QUOTE] Or use [URL="http://astyle.sourceforge.net/"]AStyle[/URL] for code formatting :P To the OP (please don't take this personal): What do you want? A bit of help or a byte of help? :P | |
Re: [QUOTE=Ancient Dragon;894326]you can use the macro isdigit() to find out if it is '0' to '9'. And the At() method is unnecessary. [icode]if( isdigit(word[i]) )[/icode][/QUOTE] Is [ICODE][B]isdigit[/B][/ICODE] a macro then? According to [URL="http://www.cplusplus.com/reference/clibrary/cctype/isdigit/"]this[/URL] information it isn't :P | |
Re: [QUOTE=ruchisharma;894490]thanks for ur reply Sir. can u tell me from where i can download this tool to convery IDL(Interactive data language) to C++ language. thanks again[/QUOTE] Yes, it's included with omniORB, you can [URL="http://omniorb.sourceforge.net/download.html"]get it here[/URL] :) After installing, follow jencas' instructions: [QUOTE=jencas;894487] If I remember correctly I wrote: "omniORB … ![]() | |
Re: >definitely it's the crappiest program language... On what arguments do you base this? C++ is a more advanced language and it will allow some things other programming languages won't ever let you do, if you write a program in C++, and you are a good programmer, this will reflect in … | |
Re: >why elcipse doesn't just give an error of "invadid comparision of char with string" or sumthing instead of talking about ints? Well, actually it does something like that: [QUOTE] C++ forbids comparison between pointer and integer [/QUOTE] The [B]pointer[/B] where the compiler is complaining about was the string with the … | |
Re: For all 2D games (e.g. platform) is [URL="http://www.talula.demon.co.uk/allegro/"]Allegro[/URL] the most likable I think :) | |
Re: And in case of positive numbers only then consider making it [B]unsigned[/B] as well :) And IMO using [B]LL[/B] it's easier to recognize it as a literal (as already mentioned) ([U]there's no doubt possible then[/U]) ... | |
Re: First: look at [B]csurfer[/B]'s post, second: look at [URL="http://www.cplusplus.com/reference/iostream/istream/read/"]this[/URL] :) BTW, Not related to the problem though: Do you deallocate the assigned memory as well (somewhere further in your code) ? | |
Re: [CODE=C++] j=i*i; while(j<100001) { array[j]=0; j+=i; } [/CODE] This will cause an array overrun :) Edit:: Sorry I replied to quickly :$ | |
Re: [QUOTE=csurfer;892671] [B]2>[/B] You better know what you are trying to do over here : [code=c++] main() char student_info, stname, clas; int rno; { [/code] [/QUOTE] It's very old C-syntax, not valid anymore in C++ :P | |
Re: [QUOTE=giftalp;872759]I have problem to start. I need algorithm for program that prompts the user to input a sequence of characters and outputs the number of vowel, using user-defined value returning function Vowel. Please help[/QUOTE] So you want to count how much times a certain vowel is encountered in the sequence … | |
Re: [B]>Please guide me how can I access the data of a void type buffer?[/B] Normally [ICODE][B]malloc[/B][/ICODE] is used in a way like this: [CODE=C] int *p; p = (int *) malloc( 50 * sizeof( int ) ); // allocate space for 50 integers [/CODE] As you can see in the … | |
Re: [B]>i dunno im sure this output the good result[/B] Did you actually write this? [B]>i dont understand why it got not the output that i want[/B] Explain us what output you are expecting, then it's easier for us to help you fixing the problem :) [ICODE][B]return getchar();[/B][/ICODE], it's not good … | |
Re: First write it in the way where you think of that it is the most efficient one, then you post your code here, and after you've posted your code, we can analyze it and make suggestions to increase performance :) | |
Check out [URL="http://video.google.com/videoplay?docid=4913196365903075662"]this[/URL] :) I would also like to be able to do that :P | |
Re: [B]>I would be very happy if u send me code.[/B] Ever considered reading this? [LIST] [*][URL="http://www.daniweb.com/forums/thread78223.html"][B]Read this before posting![/B][/URL] [*][URL="http://www.daniweb.com/forums/announcement8-2.html"][B]We can only give homework support for those who show effort[/B][/URL] [/LIST] [B]>sir how can i add two fraction nos. to get again fraction eg. a/b+c/d=(ad+bc)/bd[/B] I even don't understand a … | |
Re: [B]>i need some help in understanding pointers[/B] I assume you are talking about the following? [CODE=C++] int string_len(char *s) { char *p; p = s; while (*s != '\0') { // loop until the null-terminator (1) s++; } return s-p; // return the string's length (2) } [/CODE] (1) When … | |
Re: [QUOTE=serkan sendur;889023]just look at the constructor, and understand how nice person i am. look at the values that i pass..[/QUOTE] Come on mate, every post you make gets creepier! | |
Re: [QUOTE=yun;887378]Please mention some link of curses tutorials.[/QUOTE] [U]To the OP and every other noob who is to lazy to use a search engine:[/U] [URL="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/"]http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/[/URL] And all your ncurses related questions are covered here, including where to get it. Wow, do you know how extremely difficult it was to get this … | |
Re: Start with this: [LIST] [*][URL="http://www.daniweb.com/forums/thread78223.html"]Read this before posting[/URL] [*][URL="http://www.daniweb.com/forums/misc-explaincode.html"]Learn to post using code tags[/URL] (your code will be easier to analyze for us) [/LIST] :) | |
Re: [B]>And I've read that you should use sizeof to determine the size of a byte?[/B] No, you read it wrong, a byte is a general term for any valid combination of eight bits (and a bit is a one or a zero) ('To determine the size of a byte' ?? … | |
Re: Serkan, what a f****** idiot are you?? :angry: You just can't have a single reason to give WH bad rep for such a useful post! And don't say that it was by accident, you can only give good rep by accident, not bad rep! Sorry for my behaviour :$ ... | |
Re: [QUOTE=yun;888638]plz help me to set up pdcurses with visual studio 2005.[/QUOTE] What are you actually trying to achieve? First you hijack someone else's thread and after that you start your own thread [URL="http://www.daniweb.com/forums/thread197064.html"]here[/URL] :( | |
Re: >Does anyone see the problem in C++ -source? This code looks more like C than like C++ :) | |
Re: Try Googling on: [ICODE]"windows 1.0" torrent[/ICODE] ... Sure you will find it, I found at least one torrent ... |
The End.