1,171 Posted Topics
Re: In console (Windows) the following code will do the job: [CODE=cplusplus] #include <iostream> using namespace std; void beep(void); int main(void) { beep(); return 0; } void beep(void) { char ascii = 7; cout << ascii; } [/CODE] You just have to send the ASCII 7 - code to the screen … | |
Re: [QUOTE=kavitha1591;903310]c program to find factorial series for n values[/QUOTE] [U]First:[/U] Why do you post two times the same question? (your problem won't be answered quicker or so) [U]Second:[/U] We are not to make you such a program, you can easily put it together yourself by using a Big Number library … | |
Re: [B][URL="http://www.daniweb.com/forums/announcement8-2.html"]Quick help is always possible here on Daniweb, but there's one major exception...[/URL][/B] [edit] Double post: [url]http://www.daniweb.com/forums/post1019457.html#post1019457[/url] [/edit] | |
Re: Maybe you should try doing a Windows XP repair installation ... Your data is left intact... Maybe you also want to backup your data first, use a linux live cd for that purpose... | |
Re: [QUOTE]Could somebody help me doing this question...[/QUOTE] Yes, post down your code and tell us what you've problems with to achieve. | |
Re: [QUOTE=I_Empire;1017478]constructing a whole class to solve such a problem! is nt there any simpler solutions[/QUOTE] [url]http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17[/url] | |
Re: So actually you want your program to take a number as input, and you want a way to get back a given digit [I]n[/I] in the number? For example you have the number [ICODE]56231012[/ICODE], and you want a way to get a certain digit, for example the second, which is … | |
Re: [QUOTE] I have a lot of errors in 100% right code so I guess that compiler isnt set right. [/QUOTE] Before throwing insults to the compiler, could you maybe first post your 100% right code? | |
Re: [QUOTE]Maybe I overlooked something.[/QUOTE] I don't know whether it's the only thing, but look very closely at this: [CODE=PHP] $tens = array( 1 => 'Ten', 2 => 'Twenty', 3 => 'Thirty', 4 => 'Fourty', 5 => 'Fifty', 6 => 'Sixty', 7 => 'Seventy', 8 => 'Eighty', 9 => 'Ninety' ); … | |
Re: It would be helpful if you posted your code. (don't forget the [URL="http://www.daniweb.com/forums/announcement8-3.html"]code tags[/URL]) | |
Re: [QUOTE]any ideas what is wrong with this code?[/QUOTE] What exactly is the purpose of your code? To me it seems like you're reading a file character by character, and then printing out only the digits? Why doing a conversion to integer if you only want to print the digits out? … | |
Re: Small addition: [QUOTE=WaltP;1020192]Nothing. But [ICODE]return (0);[/ICODE] or [ICODE]return 0;[/ICODE] will exit the program and return 0 to the operating system. [/QUOTE] [I](if the return statement was placed inside the main function)[/I]. | |
Re: [QUOTE=gokhanxyz;1019716]Does the constructor create an instance of a class? or is it a member function of a class that is invoked automatically after the creation of the object is compeleted? same question about the destructor; does it deallocate the object itself or does it have the responsibility of making the … | |
Re: [QUOTE] I am having major difficulties making this computer program for school. I was hoping someone would be able to guide me in the right direction with this post. [/QUOTE] Can you maybe show us what you've attempted already? If you've nothing (i.e. no code) to show us, then this … | |
A small function which reverses a c-string by just swapping the elements :) ... Usage:: [CODE=C++] char[] str = "hello"; reverse(str); // str now contains "olleh" [/CODE] | |
Re: Before I have tried out several different Linux distro's on several different pc's, and I can only say one thing: Linux really didn't convince me at all. There are just too much things which went wrong: either the sound doesn't work, or my wireless network card, or there isn't a … | |
| |
Re: [B]>how can I put: CAN'T BE DIVIDED BY 4?[/B] [CODE] if( (N == 2) && (T % 4) ) { /* Your code here */ } [/CODE] | |
Re: [QUOTE=Ancient Dragon;863675]If you have been on MSN.com you may have already seen [URL="http://video.msn.com/?mkt=en-us&vid=b14d7a37-577a-498c-9345-86f516011832&playlist=videoByUuids:uuids:bbb5a657-3059-488e-9134-4d88bdddfe32%2C42ffc9f1-ab13-4d1e-b598-9fb9a9ffcd1e%2C70c6ab5d-53ff-47a8-8478-6769c618ee54&from=MSNHP&tab=m3>1=42007"]this video.[/URL] Its a tutorial on how to cut down a tree :)[/QUOTE] I've tried it :P | |
Re: [B]>I have tried the string length function and it does not work im wondering if someone can point me in the right direction?[/B] As StaticX has told you, you can use the [B]strlen[/B] function only if the array is a character array, like this: [CODE] char mystring[15] = "hello"; printf("%lu\n", … | |
Re: [QUOTE=hket89;956868]Could Someone tell me whats the diffrence between call-by-value with call-by-refference?[/QUOTE] Hard time using a search engine? [url]http://www.lmgtfy.com/?q=pass+by+value+or+reference[/url] | |
Re: [QUOTE=neithan;1008452][ICODE] * Don't use system("pause") to pause your program if possible. Use getchar( ) if you are using C and cin.get( ) if you are using C++. [/ICODE] Why is that? A reasonable explanations for those tips would help to learn.[/QUOTE] [QUOTE=neithan;1009152]Yes but, why don't use system("pause") at all? I … | |
Re: First off you need to decide whether you're going to use the [B]copy[/B] (Windows) or [B]cp[/B] (Linux, Unix) shell command for copying the file or whether you're manually going to write the file copy routine in C++. | |
Re: [QUOTE]Its due on monday so [B]I need help quick![/B][/QUOTE] For all those who want [URL="http://www.daniweb.com/forums/announcement8-2.html"]quick help[/URL]. | |
Re: Come on, this is already about the third time you post this question, you better spend your time in figuring out a solution to your problem, double posting is not going to help you. [U]Double posts:[/U] [url]http://www.daniweb.com/forums/thread229171.html[/url] [url]http://www.daniweb.com/forums/post1010429.html#post1010429[/url] | |
Re: [QUOTE=kulrik;1010457]i tried that. where should I put it?[/QUOTE] Show your try, then we can see what you did wrong. | |
Re: Take a look at [URL="http://www.cplusplus.com/reference/clibrary/cstring/strcat/"]strcat[/URL]. But [B]strcat[/B] on it's own won't solve the whole thing, you'll have to do some other things as well, things which I'd like you to try figure them out on your own. When you run into problems you still can fall back to this thread. | |
Re: [B]>it will return a number for example 9999, which will be an Integer. Now how to convert this 9999 into ASCII?[/B] You could use a union for this purpose: [CODE] union foo { int port; char asc[ sizeof(int) ]; } a; [/CODE] Then further in your code you can set … ![]() | |
Re: I've always found it simpler to allocate a one-dimensional array, and then calculating the row and column manually, it's an easy approach, and it works. | |
Re: [B]>This is my second post, apologies for not coming straight here[/B] No problem, I even did worse: about half a year after I registered :P | |
Re: [QUOTE=nizzy;1002136]Write a program to calculate a. Sum of diagonal elements of matrix. b. Sum of second diagonal elements of matrix[/QUOTE] And...why do I have to do this when the assignment has been given to you? I suggest you to have a nice read: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] :) Come back when you've something … | |
Re: If re-installs also count, then many, but I've only really used 2 computers simultaneously. In fact, I always use two computers simultaneously: I've one computer which connects to another one over an RDP connection, so I can use internet via remote desktop, while I can just program on my good … | |
As the title says: a C function for detecting anagrams. Returns [B]true[/B] if both strings are anagrams, returns [B]false[/B] otherwise. | |
A roman to decimal converter, no validity checking, so inputting an invalid roman number will certainly just yield a wrong result. | |
Re: Sure you'll find it [URL="http://www.lmgtfy.com/?q=Driver_IRQL_NOT_LESS_OR_EQUAL"]here[/URL]. | |
Re: Ouch, my eyes!! [URL="http://www.daniweb.com/forums/announcement8-3.html"]Please use BB Code and Inlinecode tags[/URL] [URL="http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]What's the deal with [B]void main()[/B]?[/URL] Only to shut about the use of deprecated header files and the unportable conio library, and several other includes which you better don't mix or just aren't making use of. | |
Re: [B]>any idea?[/B] I actually don't quite get the question of your assignment. Also I see no code I can help you with. But I know some interesting code which can help you to get help, here on this forum:[CODE=Java] Effort opEffort; if(opEffort == null) { System.out.println("You should urgently stop right … | |
I wouldn't recommend it but if you really want to disable it you should have to take a look at [URL="http://www.tweak-uac.com/home/"]this website[/URL] (you can download a little utility here which provides you with some easy choices) :) ... | |
Re: [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]Don't use l33t speak[/URL] Post your query (together with your code) into the appropriate forum (don't forget to [URL="http://www.daniweb.com/forums/announcement8-3.html"]use code tags[/URL]). | |
Re: [QUOTE][U]Question:[/U] a. Why does the program deliver a 8-bit hex number (0xFFFFFFFF) when the input is 0xFF and when the sizeof() delivers char as 4-bit ?[/QUOTE] This code is [B]wrong[/B] when you want to display the size of a char (in bits): [CODE=c] printf("Size of char: %d-bits\n", sizeof(char)*4); [/CODE] Sure … | |
Re: In your previous thread you've already been suggested to use code tags, perhaps you missed it? Anyway [here](http://www.daniweb.com/forums/announcement118-3.html)'s the link which will directly bring you to the page where the use of code tags is explained (read it, I'm sure that when you've read it you'll say: "Ohhh, was it … | |
Re: Great, you've got some code, and what exactly is your question? | |
Re: In addition (personally one of my favourite links): [url]http://cboard.cprogramming.com/c-programming/88495-development-process.html[/url] | |
Re: [B]>I use only linux and I am unable find the compiler. >Any help will be much appreciated as I am stuck.[/B] AFAIK it isn't available for Linux, however you might be able to get it work if you use [URL="http://www.winehq.org/"]Wine[/URL], or a very outdated Turbo C++ compiler under a [URL="http://www.dosbox.com/"]DOS … | |
Re: [QUOTE] After some time searching around the forums for a thread about an e-book for crash course from C++ to Java and no luck I decided to post a thread about it. [/QUOTE] Seems like I have a lot more luck than you: [url]http://www.janiry.com/bruce-eckel/[/url] (the Java e-book is for and … | |
Re: Damned, I also had that impression, but it could just be that I (wrongly) assume that newer is always better/faster :P But in this case I really have to admit that I've the feeling that it's working a lot faster. | |
Re: Can you show us the program with the changes you've made? | |
Re: I guess you mean all characters other than [ICODE]0, 1, 2, 3, 4, 5, 6, 7, 8, 9[/ICODE] when you say: any non-numeric character. Why not just get your number like this: [CODE=cplusplus] int num; cout << "Enter a number: "; if( !(cin >> num) ) { // Reading a … | |
Re: [QUOTE=ivatanako;984091]hi, i know this is a basic question and i have tried searching GOOGLE but it does not solve my problem. I have a array which is declared as [code] int frameScores[]; [/code] but when i tried to get its size after adding elements by using sizeof, i get a … |
The End.