1,171 Posted Topics
Re: To the OP: Well, as you have previous knowledge of C++, then you'll have no problems in understanding and applying these before start writing any other program: [url]http://cboard.cprogramming.com/c-programming/88495-development-process.html[/url] . (Please note: you can apply this process to any programming language, that's what it makes so good) | |
Re: Why would you want to wrap this [B]if[/B] around the [B]while[/B]: [CODE] if ([COLOR="Green"]k > 1 && m < n[/COLOR]) { while([COLOR="Green"]k > 1 && m < n[/COLOR]) { } } [/CODE] As you can see both conditions are the same, so you can leave out this [B]if[/B] :) Edit:: … | |
Re: [QUOTE=Dream2code;920652]Any one can please say what do we mean by a histogram??[/QUOTE] [URL="http://catb.org/esr/faqs/smart-questions.html#answers"]STFW[/URL]: Look [URL="http://www.lmgtfy.com/?q=histogram"]here[/URL]. | |
Re: [QUOTE=MrNoob;920916]well for getchar() coz sometimes i use dev when testing a program its a habbit of me to put return getchar(); rather than writing small thing since its a program made for learning[/QUOTE] Too lazy to just split them up like this? [CODE=C] getchar(); return 0; [/CODE] It's better to … | |
Re: Oh no, please not again: [url]http://www.daniweb.com/forums/thread203375.html[/url] ([B]not[/B] a double post) | |
Re: I guess you should buy a new keyboard, your comma key appears to be broken. >how to deal with it??? Read [URL="http://catb.org/esr/faqs/smart-questions.html"]this[/URL] and fix it. | |
Re: [QUOTE=new_divine;919575]i'm a bachelor student doinmg b.e in computer and as my project i've decided to make an banking application using wx widget and i'm really frustrated tring to figure it out .Being new to it i need some help[/QUOTE] What OS are you on? What IDE/compiler are you using? | |
Re: It's better to wrap code tags in noparse tags to avoid putting spaces here and there just to make it look like a code tag :P | |
Re: [QUOTE=Ancient Dragon;921079]Please [color=red]DON'T[/color][/QUOTE] LOL :P | |
Re: [B]>How to check memory usage by a program by writeing a C program.[/B] A [URL="http://en.wikipedia.org/wiki/Software_performance_analysis"]profiler[/URL] is used for such purposes. [B]>When the program terminates and we didnot free it what happens exactly?[/B] Most OSes (this means: not all!) clean up all the memory assigned to a program when the program … | |
Re: Welcome to this forum, mrestrepo30! Apparently you haven't read how to use code tags, so I'll provide you with a link: [url]http://www.daniweb.com/forums/misc-explaincode.html[/url] (please read this carefully, and in your next post, you apply what's stated in the link) I don't want to blame you for not using code tags (since … | |
Re: Just a remark on your code, as I see you're using [ICODE]system("ERASE [I]file[/I]");[/ICODE] in your code if you want to erase a file from your harddisk. I can suggest you a better, more portable and more efficient way: [url]http://www.cplusplus.com/reference/clibrary/cstdio/remove/[/url] :) | |
Re: [QUOTE=esesili;920472]Dear csurfer, I appreciate for your help,it works now. By the way, how can I do it with "call by reference" method? Some friends claim that "call by reference" is better. Do you have any suggestion about "call by reference" ? What is the advantage of "call by reference" ? … | |
Re: [QUOTE=chaines51;920607]the parameter inside the square brackets when initializing an array represents the LENGTH of an array, not the highest index.[/QUOTE] Well, you can get the upper boundary of the array by subtracting [B]one[/B] from [B]LENGTH[/B]. | |
Re: [QUOTE=lighthead;920069] 1) I thought that 'bryangarcia' did not get the line so, i helped him. It would have be a pity if the thread had dragged on just because the obvious possibility was not explored. 2) I am curious as to know as to how you would have made him … | |
Re: [QUOTE=dumrat;917305]Hi, Can someone tell me how to suppress all the warnings g++ produces? Not specific warnings : I know how to do that. I want to not see any warnings at all when I build. Thanks.[/QUOTE] I have to agree with niek_e, since there's really no reason to not want … | |
Re: [B]>I'm quite the newbie in programming...[/B] [B]>Any advice, tips or issues/concerns i should be aware of based on your experience?[/B] So, you told you're newbie, right? In that case I don't believe that this project will succeed. | |
Re: This is not a solution to your question, I only want to show you how your code would look like in more decent C++, so I basically just changed your code. [CODE] #include <iostream> #include <fstream> #include <string> [COLOR="Green"][B]#include <cstdlib>[/B][/COLOR] [COLOR="Red"]// #include <stdlib.h>[/COLOR] using namespace std; [COLOR="Green"][B]const int[/B][/COLOR] MAX_LINES [COLOR="Green"][B]=[/B][/COLOR] … | |
Re: [url]http://www.daniweb.com/forums/announcement8-3.html[/url] | |
Re: If you're on Windows, you could maybe store the password in the registry. Edit:: BTW, if I remember good, then FileZilla standard stores the passwords in an xml file. (FileZilla is written in C++, so you could maybe get your hands on the freely downloadable source code?) | |
Re: [B]>You would be better to do the conversion yourself instead of asking others to do it for you for free.[/B] Yes, 100% agreed :) To the OP: It will only cost you effort. To the OP: One thing you should remember for always and for ever is that: you should … | |
Re: To the OP: in case you're copying the whole thing (look at Sky Diploma's post, code mentioned in the link), then don't forget to change [ICODE]void main()[/ICODE] to [ICODE]int main()[/ICODE] :P And: [CODE] #include <iostream.h> #include <iomanip.h> #include <string.h> [/CODE] to: [CODE] #include <iostream> #include <iomanip> #include <cstring> [/CODE] :P | |
Re: [QUOTE] An array of 10 int pointers - same as above. [CODE=C++] int(*r[10]); cout << "\nSize of : " << sizeof(r); // 40 bytes [/CODE] [/QUOTE] [U]To the OP:[/U] Please note that if the code looked like: [CODE=C++] double(*r[10]); // <-- change made here cout << "\nSize of : " … | |
Re: [QUOTE=Himani_29;918470]yes i mean to say just that.. even i fail to understand as to howcan it happen?[/QUOTE] I really have no idea why this could happen, maybe a memory leak or something? Anyway, could you post down your code, together with the .cap files you were using before you got … | |
Re: [QUOTE=aayush2687;918371]Salem & japhthah btoh of u guyz r nt here to mprove ma englisg bt to solve r problems ,i don't think so dat u guyz knw d answer of ma question dats y u guys chng d topic to improve English ......LoLz u guyz r really sick n noob … | |
Re: Hey [I]oopg[/I], I would like to strongly advise you to learn how to use the [URL="http://www.cplusplus.com/doc/tutorial/files/"]C++ I/O File System[/URL]. | |
Re: Why would you need to use a pointer for this programming task? I think a recursive function will do fine here. It's only a small range you have to translate, so a recursive function will be the easiest in my opinion :) Also: use arrays to store the numbers (in … | |
Re: And don't forget to change line 1 of your code to: [ICODE]void swap(char **,char **);[/ICODE] :) | |
Re: Did you try: [CODE] #include <cv.h> #include <highgui.h> [/CODE] ? And oh, by the way, have you already read [URL="http://opencv.willowgarage.com/wiki/VisualC%2B%2B"]this[/URL]? | |
Re: Welcome to this forum, tangent03. Could you please check out [URL="http://www.daniweb.com/forums/announcement8-3.html"]this[/URL] page, and add code tags to your future posts? Also, [B]don't use[/B] [ICODE]void main()[/ICODE], it's evil. Instead change it to [ICODE]int main()[/ICODE]. Don't use un-standard libraries such as [B]conio.h[/B], certainly not when you're not using any function from it. … | |
Re: And another addition: all C keywords (and function names from the standard function library) are written in lowercase. As C is case-sensitive, [ICODE][B]Return 0;[/B][/ICODE] isn't valid, and has to be written like [ICODE][B]return 0;[/B][/ICODE] instead. As already told you by [I]tuse[/I], you have to put a [B]return[/B] statement inside a … | |
Re: [QUOTE=u8sand;905834]I once tried to do something like this with ONLY C++. Tried to take all the contents of a document and remake it with the same thing. The problem is though that there are some characters that may not show up (may not follow ascii char set) and their may … | |
Re: What I guess is that the name "[B]my code[/B]" is not a very appropriate name for this thread, because the OP probably didn't even write this code himself. But who knows? Only the OP, right? But if he just drops down his code on forum, without any comments, then he's … | |
Re: Okay, if you've figured it out, then it's better to mark this thread as solved. But before you do, I want to give my opinion on the use of the following name in your code: [B]I1[/B]. IMO (= In my opinion) you shouldn't use names like this, I only get … | |
![]() | Re: [B]>but I just haven't found a way to search and replace successfully[/B] Create a new file, write the changed contents to it, and delete the old file. |
Re: [B]>if anyone have it please send me the link.[/B] I don't have it, but I can give you a link to an online store, where you can legally buy it. You cannot get commercial software legally in their full flavor. (promotional actions are not taken into account here) What you're … | |
Re: [QUOTE=AirGear;914967]if we build koolplot with a graph window, then if the graph is closed, the entire code will terminate. can we close the graph without terminate the program?[/QUOTE] Double posting won't help: [url]http://www.daniweb.com/forums/thread203131.html[/url] | |
Re: Well, you want recursion? Then go to this thread and read my post: [url]http://www.daniweb.com/forums/post914703.html#post914703[/url] | |
Re: [B]>I had already tried with both function "Kbhit()" and "getch()".. but not working...[/B] You did it the wrong way, can you show us the code? BTW, you've already said three times that you've tried it, but how can we believe you? You didn't post your tries. First you should try … | |
Re: Google Chrome OS = Chrome Browser on top of a Linux kernel | |
Re: Well the error is on this line: [ICODE]printf(args);[/ICODE]. [B]printf[/B] is a function inherited from C, and therefore can't handle C++ strings, I would suggest you to use [B]cout[/B] instead: [ICODE]cout << args << endl;[/ICODE]. But you could of course also convert the C++ string to a constant C string, by … | |
Re: Well, as everything is in your main function, you could add the following statement at the place where you otherwise would have used the [B]exit()[/B] function: [ICODE]return 0;[/ICODE]. BTW, in your switch: [CODE] case 'X': op="exit"; break; default: return(0); break; [/CODE] Actually the following block of code is not needed … | |
Re: Still developing for DOS ? After a small Google search: [url]http://www.ousob.com/ng/turboc/ng4cb17.php[/url] | |
Re: Well, I know an algorithm: The [U]first step[/U] is concatenating the number one time after itself. This will give us the opportunity to easily find the first part of the possibilities. The [U]second step[/U] is, reverse all the possibilities we've got in the first step, and that will give us … | |
Re: [QUOTE=Cloneminds;914398]Should I just make it a while statement and forgo the do?[/QUOTE] Well, you could simply do the following: Change: [CODE] total = total + number; [/CODE] To: [CODE] if(number != -1) total = total + number; [/CODE] Edit:: But wouldn't it be better to take [B]0[/B] as value to … | |
Re: [QUOTE=akulkarni;914823][code] thanks it worked it was silly on my part i guess [/code][/QUOTE] Please don't write whole posts in code tags, instead use code tags only whenever you need to post a snippet of code. [B]>it was silly on my part i guess[/B] No, it's certainly not silly to ask … | |
Re: For getting the size, you can already use the [B]strlen[/B] function: [CODE] size_t sz; sz = strlen(s); [/CODE] You can use [B]new[][/B] and [B]delete[][/B] for the memory allocation to hold the desired string. After that, you copy the string passed via the argument to the newly allocated memory, use [B]strcpy[/B]. … | |
Re: [QUOTE=Lerner;914407] [code] bool moreInput = true; char temp; while(moreInput) { //get input cout << "enter y to keep going, anything else to stop" << '\n'; cin >> temp; if(temp == 'y') moreInput = false; } [/code] [/QUOTE] I always would write the following line: [ICODE]if(temp == 'y')[/ICODE] as [ICODE]if( [B]tolower(temp)[/B] … | |
Re: [QUOTE=Ancient Dragon;914229]If you want the C method [code] char iobuf[255]; long ints[255] = {0}; int i = 0; // get each line of the file while( fgets(iobuf, sizeof(iobuf), fptr) != NULL) { ints[i] = atol(iobuf); } [/code][/QUOTE] Hey AD, where are you increasing [B]i[/B] ? According to that code, all … | |
Re: Drawing a graph? [url]http://codecutter.org/tools/koolplot/[/url] |
The End.