1,171 Posted Topics

Member Avatar for jeanfrg

[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?

Member Avatar for jeanfrg
1
2K
Member Avatar for saggy_rudra

[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 …

Member Avatar for WaltP
0
149
Member Avatar for mahela007

[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]

Member Avatar for Rashakil Fol
0
125
Member Avatar for deeep

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]

Member Avatar for deeep
0
205
Member Avatar for vegaseat

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 …

Member Avatar for mitrmkar
2
233
Member Avatar for William Hemsworth

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 …

Member Avatar for vivosmith
2
426
Member Avatar for Rahul8389

Do you mean the application's startup path ? > Application.ExecutablePath or > Application.StartupPath should work :) ...

Member Avatar for shahab_qureshi
0
87
Member Avatar for Iam3R

[QUOTE=xavier666;1164645]I didn't get you [B]"the implementation must convert it..."[/B][/QUOTE] The [I]compiler[/I] must convert it...

Member Avatar for nezachem
0
226
Member Avatar for BrandonB

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 : …

Member Avatar for BrandonB
0
124
Member Avatar for mirness

Please be more specific about your problem, also show some [URL="http://www.daniweb.com/forums/announcement118-2.html"]effort[/URL].

Member Avatar for xavier666
0
53
Member Avatar for DoEds

[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 …

Member Avatar for jonsca
0
114
Member Avatar for Idontknowc

[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].

Member Avatar for Ancient Dragon
0
121
Member Avatar for DoEds

[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() …

Member Avatar for DoEds
1
278
Member Avatar for happygeek

[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]

Member Avatar for Dave Sinkula
0
525
Member Avatar for William Hemsworth

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 …

Member Avatar for William Hemsworth
0
765
Member Avatar for sonai4u
Member Avatar for tux4life

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. …

2
1K
Member Avatar for sealxlion
Member Avatar for higuain14

[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]; // …

Member Avatar for naresh.M
0
115
Member Avatar for md21holla

[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 …

Member Avatar for tux4life
-1
905
Member Avatar for yun

>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 :)

Member Avatar for miguelbezerra
0
2K
Member Avatar for tux4life

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 :)

0
161
Member Avatar for phpangel

[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 …

Member Avatar for tux4life
0
958
Member Avatar for bman214

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 …

Member Avatar for bman214
0
143
Member Avatar for smbee

[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 …

Member Avatar for smbee
-1
308
Member Avatar for pucivogel

[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?

Member Avatar for pucivogel
0
1K
Member Avatar for Shaikh Mohsin

[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) …

Member Avatar for tux4life
0
140
Member Avatar for sweetbony

[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 …

Member Avatar for tux4life
-5
118
Member Avatar for Draculaboy1014

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?

Member Avatar for tux4life
0
118
Member Avatar for Nikhar

[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 …

Member Avatar for tux4life
-6
195
Member Avatar for prachi bhujbal

[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, …

Member Avatar for tux4life
-6
71
Member Avatar for Xeros606
Member Avatar for valleymorning

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 …

Member Avatar for Sudar_Gudi
0
2K
Member Avatar for coolfriend

You've already a good thought of what your program should do, why not try implementing it yourself first?

Member Avatar for Nick Evan
0
87
Member Avatar for ball3r

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]

Member Avatar for WaltP
0
5K
Member Avatar for Alerwi

[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).

Member Avatar for tux4life
0
115
Member Avatar for ryy705

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 …

Member Avatar for tux4life
0
225
Member Avatar for xavier666

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 …

Member Avatar for Narue
0
426
Member Avatar for Bobon

[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 …

Member Avatar for Bobon
1
190
Member Avatar for Shillz

[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; } …

Member Avatar for Shillz
0
153
Member Avatar for Nhevik

[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].

Member Avatar for mrnutty
0
171
Member Avatar for ayesha91

[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?

Member Avatar for Lerner
0
159
Member Avatar for davewhite

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 …

Member Avatar for tux4life
0
126
Member Avatar for Pamilerin

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 …

Member Avatar for tux4life
0
79
Member Avatar for gerard4143

I could also come up with the correct answer before I ran the program, but it certainly caught my brain for a few minutes.

Member Avatar for gerard4143
0
142
Member Avatar for regist1

[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 …

Member Avatar for tux4life
-1
211
Member Avatar for uzair ahmad

[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.

Member Avatar for tux4life
-4
124
Member Avatar for arshad115

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 …

Member Avatar for Cokaric
0
6K
Member Avatar for girl.java

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 …

Member Avatar for tux4life
0
98
Member Avatar for tux4life

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]

Member Avatar for William Hemsworth
0
3K

The End.