1,171 Posted Topics
![]() | Re: [CODE] boolean cmd_start = false; boolean cmd_stop = false; boolean cmd_forward = false; boolean cmd_reverse = false; boolean cmd_right = false; boolean cmd_left = false; [/CODE] Wouldn't it be a better idea to make these [B]private[/B] instead of using the [B]default[/B] access specifier? ![]() |
Re: [QUOTE=saggy_rudra;1192578]dunno where shud i start..but am having real trouble understanding file handling...see, i know how to read n write into a file..but lets say i've run the program once n stored some data in to the file say abc.txt, but when i rerun n display the contents it shows the … | |
Re: [QUOTE=mahela007;1187846]Thanks for the reply.. but could someone explain this in a little more detail?[/QUOTE] Try this: [url]http://www.cplusplus.com/reference/clibrary/cstdio/[/url] | |
Re: While you're at it, you might find the following linked list tutorial useful: [url]http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx[/url] | |
Re: This is just a slightly modified version of the Queue implementation found in the book C: The Complete Reference by Herb [URL="http://catb.org/jargon/html/B/bullschildt.html"]Schildt[/URL]. You should take care when using code that was written by Herb Schildt, especially because his code is widely known as buggy code, and you may not have … | |
Re: She/He still doesn't want to believe that I am a human :'( [QUOTE] User: Hi, my name is tux4life. Cleverbot: What a strange name! User: Yeah, I know, it's my nickname. Cleverbot: Do you always say yes? User: No. Cleverbot: What do you do on your days off? User: Nothing … | |
Re: Do you mean the application's startup path ? > Application.ExecutablePath or > Application.StartupPath should work :) ... | |
Re: [QUOTE=xavier666;1164645]I didn't get you [B]"the implementation must convert it..."[/B][/QUOTE] The [I]compiler[/I] must convert it... | |
Re: You could perhaps use the ternary operator? [CODE=C++] int foo(int a, int b, int c, int d, int e) { int min = a; min = min > b ? b : min; min = min > c ? c : min; min = min > d ? d : … | |
Re: Please be more specific about your problem, also show some [URL="http://www.daniweb.com/forums/announcement118-2.html"]effort[/URL]. | |
Re: [B]>Its keeps animating and i dont know when will this stop...[/B] Answer: Theoretically this won't ever stop, because there's an infinite loop in your [ICODE]main()[/ICODE] function: [CODE] for ( ; ; ) { if ( x > 3 ) x = 0; printf ( "%c\b", barRotate[x++] ); sleep ( 200 … | |
Re: [B]>this is what I started with my knowledge and so far ive got[/B] What you started with your knowledge? Nah, you just copied it from C: The Complete Reference by Herbert [URL="http://catb.org/esr/jargon/html/B/bullschildt.html"]Schildt[/URL]. | |
Re: [QUOTE=jonsca;1151740]Neither lol. [code] int i; for (i = 0;array[i] !='\0';i++) { if(array[i] =='\n') array[i] = '\0'; } [/code][/QUOTE] This won't generate desired output in all cases, let me illustrate this with an example: [B][U]Case I: Using WaltP's approach to remove the newline character[/U][/B] [CODE=C] #include <stdio.h> #include <string.h> int main() … | |
Re: [QUOTE=crunchie;1114050]I cannot remember what I did last [I]week,[/I] let alone 6 years ago :)[/QUOTE] That's where the powerful search feature of this forum comes in, I could find it for you: [url]http://www.daniweb.com/forums/post15701.html#post15701[/url] :P BTW, this was mine first post :$: [url]http://www.daniweb.com/forums/post813389.html#post813389[/url] | |
Re: Writing a Sudoku solver is a very interesting project, it's not as easy as it looks like I think... Maybe the following link is useful for you: [URL="http://www.codeproject.com/KB/game/sudoku.aspx"]http://www.codeproject.com/KB/game/sudoku.aspx[/URL] (maybe just useful for the algorithm) And this link might also be useful: [URL="http://translate.google.com/translate?prev=hp&hl=en&u=http%3A%2F%2Fwww.keesmoerman.nl%2Fsudoku.html&sl=nl&tl=en"]http://translate.google.com/translate?prev=hp&hl=en&u=http%3A%2F%2Fwww.keesmoerman.nl%2Fsudoku.html&sl=nl&tl=en[/URL] (translated from Dutch, you can download the source … | |
Re: Since we're too expensive for you, I'm afraid that you'll have to do it yourself. | |
Some things you need to know: [LIST] [*]This code is not efficient, if you want a more efficient solution, then turn to the STL algorithm [URL="http://www.cplusplus.com/reference/algorithm/next_permutation/"]next_permutation[/URL]. [*]When there are double characters (i.e. characters which occur multiple times) in the string to permute then some permutations will be generated multiple times. … | |
Re: First improvement possible: indent your code. | |
Re: [QUOTE]I get a segmentation fault for some reason. Any ideas?[/QUOTE] Yes, you should make sure that you don't override the array boundaries. Therefore you should rather change your code to something like this: [CODE] #include <iostream> using namespace std; int main() { const int MAX_ARRAY_SIZE = 10; int numbers[MAX_ARRAY_SIZE]; // … | |
Re: [QUOTE=md21holla;1131540]thats what i got so far. i cannot figure the rest out. [/QUOTE] Okay, let's take a look at it. [B][U]A:[/U][/B] [QUOTE=md21holla;1131540] a. int[] numArray = new int[10]; for([COLOR="red"]i = 0[/COLOR]; [COLOR="Red"]1[/COLOR] < numArray.lengh;i++) { numArray[i] = i + 1; System.out.println([COLOR="red"]""[/COLOR] + numArray[i]); } [/QUOTE] The items which are marked … | |
Re: >pdcurses works well with code::blocks but is there any way to use pdcurses with visual Studio, plz help. Yes, it's possible, [U]look at the [B]README[/B][/U] file :) | |
Intended as a replacement for [URL="http://www.daniweb.com/code/snippet217322.html"]this[/URL] old crap of myself ;) Note: no error checking provided, if you need it, then you can easily implement it yourself :) | |
Re: [QUOTE=hag++]you always need to declare variables BEFORE you [I]use[/I] them.... its not only C++[/QUOTE] Your statement is correct for strongly typed languages, but doesn't apply to loosely typed languages such as PHP: [QUOTE=PHP Variables] PHP is a loosely typed language In PHP, a variable does not need to be declared … | |
Re: Although we could debug your code, we charge too much, so you'll have to learn the craft of debugging yourself, as every programmer does/should. If you follow the instructions listed [URL="http://cboard.cprogramming.com/c-programming/88495-development-process.html"]here[/URL], you'll be able to avoid cases like this one in future. Also your whole program is contained within the … | |
Re: [QUOTE]There are some errors. could you please point out where I am wrong?[/QUOTE] The compiler will gladly point them out for you. Not an error, but a logical error in your program which won't be reported to you by your compiler is that you use the assignment operator [ICODE]=[/ICODE] instead … | |
Re: [QUOTE] how am i supposed to do the reservation,and select rooms for 2 persons or one and rooms that overlook the sea or the road [/QUOTE] Could you please post your whole assignment, including the GUI-code you have written so far? | |
Re: [QUOTE=Shaikh Mohsin;1110508]Hello Friend i want C program to scan Operating System on network,and display the output and can it is possible to connect to that particular OS.....or is there any other way to achieve this thing.[/QUOTE] (this is your request) [QUOTE=Salem;1110574][url]http://nmap.org/[/url][/QUOTE] (this is an answer which fully serves your request) … | |
Re: [QUOTE]I am looking for the code for student management.[/QUOTE] Well, you've got two options: [U]Option 1:[/U] [B]Use Google[/B] to find a solution. (Use this option if you're a lazy cheater who won't get anywhere in real life) [U]Option 2:[/U] [B]Use your brain[/B] and write your own solution. (Use this option … | |
Re: Let me check if I get the goal of your project. You want to create a LetterCounter class with a doCount() method which takes a string and the character to count? | |
Re: [QUOTE=Nikhar;1109985]As far as I know, I have been preparing for this competition for quite some time now. I have been studying graphs, trees, shortest paths, backtracking, dynamic programming etc.[/QUOTE] Great, you've studied some things! Unfortunately for you but programming is not only studying, it also involves problem solving skills. And … | |
Re: [QUOTE=prachi bhujbal;1107074]Can anyone provide me certain project topics in c/c++? i wan a sooner reply[/QUOTE] Can't you just think of something yourself? I don't know how much experience you have with programming in C, but you should. You've probably complained a whole year about the fixed programming tasks you've got, … | |
Re: [url]http://www.parashift.com/c++-faq-lite/[/url] | |
Re: This function won't work correctly when you convert multiple strings to their uppercase equivalents. Yes, you return a pointer, but to something in static memory. When you for example let your function uppercase "hello", your function will return a pointer to "HELLO", okay you save the memory address, then you … | |
Re: You've already a good thought of what your program should do, why not try implementing it yourself first? | |
Re: By simply using Google I found these nice links: [LIST] [*][url]http://www.cs.bu.edu/teaching/alg/maze/[/url] [*][url]http://www.dreamincode.net/forums/showtopic94248.htm[/url] [/LIST] | |
Re: [url]http://www.amazon.com/SCJP-Certified-Programmer-Java-310-065/dp/0071591060/ref=pd_sim_b_3[/url] This is the book you should definitely buy when you want to prepare yourself for a Java Certification Exam (SCJA or SCJP). | |
Re: For anyone who's still not getting it: [I]References[/I] are bit patterns which describe the location of an object in the JVM's memory. References are kept inside [I]object variables[/I], that is: object variables contain references. Java is [I]pass-by-value[/I], that is [I]pass-by-copy[/I], when you pass a value to a method, then its … | |
Re: You could maybe do it by building a linked list of character variables? Another approach is each time allocating the memory needed for the current string plus 1 and copying your string to the newly allocated memory (and deallocating the previously used memory afterwards), but it is very inefficient for … | |
Re: [QUOTE]As said before, you should check the month before the day because February the 30th is not valid.[/QUOTE] Of course you should, and just for the sake of clarity, if you don't, then you risk an array boundary overrun (imagine that [ICODE][B]month[/B][/ICODE] is bigger than 12). Also, [QUOTE] [CODE] if … | |
Re: [QUOTE=Shillz;1018265]how can we use a printf statement without a semicolon??? this was a question asked during an interview of a computer engineering student.[/QUOTE] You can always put the call to [B]printf[/B] in an [B]if[/B]-statement, like this: [CODE=c] #include <stdio.h> int main(void) { if( printf("Hello World!\n") ) {} return 0; } … | |
Re: [QUOTE=Nhevik;1093922]how to create a program using C++ pls tech me :P ;)[/QUOTE] Read a [URL="http://www.cplusplus.com/doc/tutorial/"]tutorial[/URL]. | |
Re: [QUOTE=WaltP;1091943]Actually, a [ICODE]string[/ICODE] is [I]not[/I] "null terminated". Period.[/QUOTE] Well, the user could manually terminate it with a nul-character, not? | |
Re: Welcome to Daniweb, and a Happy New Year. To get to the point: there are some improvements possible to your code, but that of course depends on your current knowledge, for example: are you familiar with writing your own methods and/or using arrays? If you know how arrays work, then … | |
Re: Please let me clear your doubts: a polynomial is [I]a sequence of terms[/I], a term consists of a coefficient and the power of the variable 'x', to store a polynomial, you should define an array which can hold six terms, where does this six come from? Well, [QUOTE] Your program … | |
Re: I could also come up with the correct answer before I ran the program, but it certainly caught my brain for a few minutes. | |
Re: [QUOTE]I'm lost.. I have no idea[/QUOTE] I once did a conversion from roman to decimal using the following approach: [LIST] [*]I created a function to translate every roman symbol: [ICODE]M, D, C, L, X, V, I[/ICODE] to its decimal equivalent. [*]I let my program read the roman number into a … | |
Re: [B]>Help me in Game of Life[/B] Life's not a game, you have to live on your own, the same goes for your programs: you have to write them yourself. Come back when you've something to show us. | |
Re: Maybe you should just try to call 'return <something>' in your code ... After the return instruction no code is executed anymore so the function will go back to 'main()' (if the function is called from the 'main()' function) P.S. : Can you please post us some code so we … | |
Re: You're making things more complex than they are, why for example do you use a switch? It's very error-prone for this task. I would rather opt for another approach, I'd make use of Strings which hold all the vowels, consonants and punctuation marks you want to count and then use … | |
This is a [B]toupper[/B] and [B]tolower[/B] implementation for whole c-strings, without making use of the existing [B]toupper[/B] and [B]tolower[/B] functions for characters :) [U] example:[/U] [CODE=C]char s[]="Hello, beautiful world!"; stoupper(s); // s now contains: `HELLO, BEAUTIFUL WORLD!´ stolower(s); // s now contains: `hello, beautiful world!´[/CODE] |
The End.