2,839 Posted Topics
Re: I'll try one more time: [URL="http://www.daniweb.com/forums/announcement118-3.html"]CLICK THIS BLUE UNDERLINED LINK[/URL] [noparse][code=cpp] YOUR CODE HERE [/code][/noparse] | |
Re: [QUOTE=Radical Edward;616846] Ed's code assumes that there won't be any leading whitespace.[/QUOTE] Ed's code also assumes the words on each line won't contain whitespaces :) If Niek would program this, it would look more like [code=cpp] inFile.open("data.txt"); if (inFile.is_open() ) { while (getline(inFile,product)) { if (product[0] != '#') cout << … | |
Re: [QUOTE=SACHIN4TCS;615884]Write a program that will read in a number from 0 to 9 and spell out that number. The program must also report any values that are out of range.In other words, for an input say 2, output should be two[/QUOTE] SIR YES SIR! [quote=SACHIN4TCS] its very urgent[/quote] Oh dear, … | |
Re: I guess I would go for: English (or Dutch, German, etc) Chinese Arabic Why? Because these three are very different from each other. From char-set to idiom and grammar. This would increase the change that someone could translate at least one of them. | |
Re: This is [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]not a free homework service[/URL]. You'll have to show some effort before you get help. So post what you've done so far. Or ask specific questions | |
Re: [QUOTE=nav33n;612257]Cscgal, everytime I see your profile...[/QUOTE] [i]Everytime[/i]? Do do you want a lame remark about that ? ;) | |
Re: You're right. The two lines are identical. Let's take [icode]for(int i =0 i <10; i++) { //do stuff}[/icode] for example. another way to write this code is: [code] int i=0 while (i< 10) { // do stuff i++; } [/code] As you can see in the code above, it doesn't … | |
Re: An Interrupt handler that took too many clockcycles to finish. So once in n-times it was called again before it was finshed... ( on a uC btw) That gave me a hell of a headache. | |
Re: Please post your code here between [noparse][code=cpp] code here [/code][/noparse] I personally don't like opening attachments [QUOTE=hewara;616070] the result that i want to get is "value of myarray[0]=0.577 or 0.5" and the others value of myarray[1] and value of my array[2] is zero. [/QUOTE] So what value ARE you getting? | |
Re: Why are you using the C way to read a file and store it's contents? Why not use std::strings, that would solve all your problems! [code=cpp] #include <string> #include <fstream> #include <iostream> using namespace std; [.....] string str_read; ifstream fin("file.txt"); if (fin.is_open()) cin >> str_read; else cout << "couldn't open … | |
Re: the >> operator will always discard whitespaces. You could use getline(), which keeps whitespaces: [code=cpp] #include <iostream> int main() { std::string str; getline(cin,str); cout << str << endl; cin.get(); return 0; }[/code] input : [icode]hello world![/icode] output: [icode]hello world![/icode] and in your case you could even use it to loose … | |
Re: You've got a question about that are do you just like posting code? :P | |
Re: First of all: Thank you for using code-tags in your very first post! Good job. Now for your problem: How about sending the data by reference? Here's an example of passing a value by reference: [code=cpp] #include <iostream> using namespace std; void timestwo(double* num) { *num*=2; return; } void addone(double … | |
Re: as my signature says: [icode]= != ==[/icode] (= is not the same as ==) in this line: [icode]if (symb = 'E' || symb = 'F')[/icode] you meant: [icode] if (symb [b]==[/b] 'E' || symb [b]==[/b] 'F') [/icode] The first statement says: if (assigning 'E' to 'symb' succeeds) return true The … | |
Re: [QUOTE=nelledawg;615747]Ok well, I did a little research and duh, forgot about system("pause") AND getch()! Which would be more acceptable to use?[/QUOTE] I would strongly suggest that you use neither. - getch() is only supported by the Turbo compiler (as far as I know anyway) - system("pause") won't work on a … | |
Re: You should post your compiler errors, but what I see right away: [quote] Date::set_default(9,7,2000); Date S(3,7,1991); [/quote] You call the function set_default before you created the class. And you call the memberfunction the wrong way (Date:: instead of S.) So change the two lines to: [code=cpp] Date S(3,7,1991); S.set_default(9,7,2000); [/code] … | |
Re: Where to begin... The code you posted is barely recognizable as C++... I suggest you dump the entire code in the trashbin. I'll give you a small part of the code to get you started [code=cpp] #include <iostream> using namespace std; int main() { int measured = 0, calculated =0; … | |
Re: What mitrmkar said. You can prevent these errors by indenting your code. Example what you write: [code] int main() { for (int i = 0; i < 5;i++) { for (int j= 0; j < 5;j++) { if (j==i) { cout << "yeah"; } } } return 0; } [/code] … | |
Re: [QUOTE=Ravenn;615349] try1.obj : error LNK2001: unresolved external symbol "public: __thiscall L_No::L_No(int)" [/QUOTE] In the class declaration you say: [code] public: L_No(int iNumber);[/code] But there's no definition of this constructor. So add: [code=cpp] L_No::L_No(int iNumber) { // do stuff with int iNumber }[/code] And your code should compile. [QUOTE=Ravenn;615349] if i … | |
Re: You probably have something like: [code] char str[] = "hello"; char ch= str; [/code] Then : no. str is an array of chars, so it won't fit in one char. you [i]could[/i] do [icode] ch = str[0][/icode] What are you trying to do? Could you post some code? | |
Re: You mean something like: [code=c] char *buffer; buffer = inet_ntoa(address.sin_addr);[/code] | |
Re: That would be me. What are you working on? and if you'd like more support, join the [URL="http://tech.groups.yahoo.com/group/OpenCV/"]YAHOO! OpenCV group[/URL]. | |
Re: Is it a requirement that you program this yourself? Else I would say: Why not use excel? All the functionality described above can easily be implemented in Excel | |
Re: E-Books on what? I can't imagine that you bought 600 books on C++ right? | |
Re: If you say that it only works on one revision of a specific MOBO, the change is that they integrated some sort of copy-protection. I think your best shot would be asking Williams for more detail or maybe even the sourcecode (allthough I doubt that they'll give it) | |
Re: Post the first few errors you get (in detail) and post some code. My best guess at this moment is that you are using some linux-specific functions that can't be found in windows. But without seeing the code, I can't be sure | |
Re: I'm actually working with a program for a Fujitsu uController at the moment. Written by (with all respect) an old-school programmer. static this, extern that... bleh.. I'm more of a 'throw pointers around' kind of guy :) | |
Re: [QUOTE=seeker55;612055]Thanks a million[/quote] Is guess you missed the sarcasm underneath? [quote=seeker55;612055]I know I messed up that's why I'm looking for help now[/QUOTE] To little, to late. How should we know what you have to learn? When are the exams coming up? Don't you have time to ask your teacher for … | |
Re: Correct me if I'm wrong, but that isn't ansi-c right? Anyway, it's platform dependent. But for a Windows system Duoas' solution will work | |
Re: What is STATE_SONAR and what are the values of State[] ? | |
Re: [URL="http://en.wikibooks.org/wiki/QBasic/Graphics"]start here[/URL] And come back when you have some code to show that you've made an effort ps. Don't start a new thread on the same subject just because the 'mean computergeeks' here at Daniweb won't give you some free code to cheat you through your class | |
Re: open the file, then read it one char at a time. Then use [URL="http://www.cplusplus.com/reference/clibrary/cctype/isdigit.html"]isdigit [/URL]on every char: [code=cpp] string str =""; if (!isdigit(input_char)) { str+=input_char; } [/code] When the loop is done, 'str' will contain your file without numbers. | |
Re: After 62 posts and a lot of reminders (I told you 3 times already) you're still not using code-tags. Edit your post and put the code in [noparse][code=cpp] //your code here [/code][/noparse] tags. Did you even read the error message? It says it can't find main(). Now look in your … | |
Re: Thank you for using Code-tags! If your not changing the any of the values in the Class (card) c, why would you want to pass by reference? To make it easier for yourself, how about: [code=cpp] ostream& operator<<(ostream& out, Card c) { out << c.getSuit(); return out; } [.....] int … | |
Re: [QUOTE=Traicey;612264]... and for some reasons I cant open the files... [/QUOTE] That looks like an excellent place to start. How about just posting the code for opening files? | |
Re: So this is a working program? It's all commented out, so it probably doesn't do very much. Perhaps you could tell us what this is supposed to do, instead of dumping a lot of code here with the title "just in case you wanted to know". If you call it … | |
Re: [QUOTE=Serunson;611693]Wilkommen nach Daniweb! (Welcome to Daniweb!)[/QUOTE] Actually it's Wilkommen ZU Daniweb. Nach and Zu both mean 'to', but 'nach' is used when you say: 'I'm going TO' (Ich gehe nach) and 'zu' is used when saying: 'Welcome TO' (Wilkommen zu). It's German by the way | |
Re: Yesterday I got it for the first time ever. I run XP with Firefox 2 | |
Re: Please post your code here instead of giving it as an attachment. I'm not going to open a zip file of 1.04 MB, that should contain code. 1.04 MB of text is rather much. So just post your cpp file(s) here and be sure to use [noparse][code=cpp] //code here [/code][/noparse] … | |
Re: Free ones: [URL="http://msdn.microsoft.com/en-us/express/future/bb421473.aspx"]Visual Studio 2008[/URL] (click Visual C++) [URL="http://www.codeblocks.org/downloads"]code::blocks[/URL] [URL="http://www.bloodshed.net/download.html"]bloodshed devc[/URL] I recommend the first two, because they're still being upgraded and improved | |
Re: >>I need solution to this immediately. .... >>Its urgent Sorry it took so long but here it is: [code=cpp] #include <iostream> int main () { char a='c',c[3],b=a; std::cout << ++a << (char)((a&b)+21) << b << (char)(a+(7*sizeof(char))); a = 0x6F; b = (char)(sizeof(int)*sizeof(int)*sizeof(int)+50); memcpy(c, "ll", sizeof(char)*sizeof(c)); std::cout << b<< a<< c; … | |
Re: And if you want a newline behind an icode line, you have to give an extra enter: [icode]cout << 1;[/icode] hello In the inputfield ; the line above was 2 lines. (I gave an enter behind the icode line) [icode]cout << 1;[/icode] hello In the example above I had to … | |
Re: [QUOTE]The problem is with this line:[/QUOTE] What is the problem with that line? After 27 posts you should know that you should use CODE-tags when posting code. So read [URL="http://www.daniweb.com/forums/thread78223.html"]this [/URL]about code-tags and problem-description. But since I'm in a good mood, I've thrown your code in my compiler and the … | |
Re: [QUOTE=Sky Diploma;610431]You can also use Character Arrays [code] char title[30]; cin.getline(title,30); [/code] This will even take in spaces between words too.[/QUOTE] Too 'C' for me. How about combining the two posts and do it like: [code=cplusplus] string title; getline(cin, title); [/code] Now we can still use std::strings AND it takes … | |
Re: Here's a [URL="http://tldp.org/LDP/abs/html/"]link [/URL]with a tutorial I'm currently fighting with. In [URL="http://tldp.org/LDP/abs/html/writingscripts.html"]Appendix M[/URL] there are a lot of exercises ranging from easy to hard. | |
Re: [QUOTE=wellibedamned;611538] kinda doesn't work... anyone knows why? [/QUOTE] [edit] AD solved that problem already [/edit] Anyway, if you're using C++, why not use std::strings, find() and substr()? Demo: [code=cpp] #include <iostream> #include <string> int main () { std::string str = "This is a line of text"; int lastspace= str.find_last_of(' ') … | |
For some time now, the images attached to posts have been unreadable. I never thought of this as a problem until I realized that when people aren't using code-tags, I always refer them to this [URL="http://www.daniweb.com/forums/thread93280.html"]thread [/URL]. But since the images are mutilated beyond recognition, this thread won't teach newbies … | |
Re: * Applauds * Do you have a question? If the question is: why doesn't this work, then the answer is: because it's all comment ( /* */ ) | |
Re: You are designing a MicroController and writing your own compiler for it?? But you don't understand how to search for words in a file? hmm... Behold: The amazing powers of [URL="http://www.google.nl/search?hl=nl&q=changing+font+color+richedit+mfc&btnG=Zoeken&meta="]google[/URL] The first and third link look promising | |
Re: [QUOTE=John A;611212] I'd recommend this one, written by one of our moderators here: [url]http://www.gidnetwork.com/b-61.html[/url][/QUOTE] What he^ said. But if you want to go the full 10 yards: [URL="http://www.daniweb.com/forums/thread90228.html"]click[/URL] . It's written by another Moderator. |
The End.