2,839 Posted Topics
Re: Damn, after DMR, Stymiee and Narue, I thought [i]I[/i] was next in line :) But: Congrats ~s.o.s.~! Have fun kicking behinds ;) | |
There are a lot of threads asking to add new forums to Daniweb. These questions are usually answered by saying that DW has more then enough forums and I agree. So how about cutting back in some of the less successful forums like the [URL="http://www.daniweb.com/forums/forum14.html"]Computer Science[/URL] forum? In this forum … | |
Re: [QUOTE=Ancient Dragon;921457]Do I really need to ? I've been a member here since the stone ages.:)[/QUOTE] Why not? | |
Re: [QUOTE=twomers;941221]I go for a grazing cammel double playerLifeForce;[/QUOTE] I choose the Hungarian grazing Homer Simpson : [icode]bool iDuff = true;[/icode] | |
Re: [QUOTE=firstPerson;924075] //THAT SHOULD START YOU I HOPE[/QUOTE] Why on earth did you do that?? Here's how [B]I[/B] read this thread: OP (Sunyah): Hi. I got this homework assignment and didn't have the slighest clue on how to make it. But luckily I found this code on the interwebs. Problem is: … | |
Re: [QUOTE=cscgal;937631]Oh I think I know what's causing this :)[/QUOTE] I bet it's the flux capacitor :icon_cheesygrin: | |
Re: Here's [URL="http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html"]the best tutoria[/URL]l on the net | |
Re: [QUOTE=mathavan2009;935191] explain the basic concepts.[/QUOTE] C++ is a language that you can use to write programs. | |
Re: [QUOTE=143wena;935060]our teacher want us to make a menu system or payroll system.. but i dont know how to do it because she only teach us like this.. #include<stdio.h> #include<conio.h> void main() { char name[15}; clrscr(); printf("Enter your name"); scanf("%s",&name); printf("%s",name); getch(); }[/QUOTE] If your teacher has thought you this, she … | |
Re: [code=cplusplus] #include<iostream> int main(){ std::cout << "........1\n......1 2 1\n....1 2 3 2 1\n..1 2 3 4 3 2 1\n1 2 3 4 5 4 3 2 1"; }[/code] or you could try something with loops. But seriously: You should start by writing these problems on paper. Then step by step … | |
Re: [QUOTE=mandofl;933093]and pass each one in turn to a function that displays the information about the movie in a clearly formatted manner. [/QUOTE] You did not yet make a function to display the structs yet. So you will need to create somethink like: [code=cplusplus] void Display(Moviedata moviein){ // display the thing … | |
Re: [QUOTE=funjoke88;930803] i have the answer in c++ code can anyone help me change back to c code .thanks[/QUOTE] So you found some code on the interwebs but, too bad for you, it's in the wrong language. And now your asking us to write the code for you? That's [URL="http://www.daniweb.com/forums/announcement8-2.html"]not how … | |
Re: In your button handler, put something like: [code=cplusplus] wxFrame* f = new wxFrame(this, -1, wxT("A new window"), wxDefaultPosition, wxSize(800,600)); //for example f->ShowModal(); [/code] | |
Re: Use could use a function like: [code=cplusplus] bool exists(string filename){ ifstream infile(filename.c_str()); if (infile.is_open()){ infile.close(); return true; } return false; }[/code] the flaw in this function is that it'll also return false when a file does exist but can't be opened. | |
Re: [QUOTE=StephyGraph;932983] Please do email me d code....n thanks for your assistance.[/QUOTE] Haha, but [URL="http://www.daniweb.com/forums/announcement8-2.html"]no[/URL]. | |
Re: The problem is that when the class is created, n and m do not have a value yet, so the compiler doesn't know how big you want your array. So you need to dynamicly create the array using new and delete. Here's how I'd do it: [code=cplusplus] class matrix { … | |
Re: I do not get you people. Why can't you think of a topic yourself, it's not that damn hard. But whatever, here you go: [search]project topics[/search] Or you could try the enormous [URL="http://www.daniweb.com/search/search.php?q=project+topics"]searchbox [/URL]on the top of this page. And here's another [URL="http://lmgtfy.com/?q=project+topics+c%2B%2B"]amazing site[/URL] for you. | |
Re: [QUOTE=ithelp;931057]Use lex , yacc , bison, etc. it is not that difficult , give it a try.[/QUOTE] Tell me how this advice will help the op solves his(her) problem, I'm curious... | |
Re: [URL="http://www.cplusplus.com/doc/tutorial/functions/"]Tada[/URL] | |
Re: You need more then just the header files. How would your compiler know what to do with just the headers? Go [URL="http://mspgcc.sourceforge.net/"]here [/URL] | |
Re: So you thought : "Hey, [URL="http://www.daniweb.com/forums/post930868-2.html"]that's not a source code[/URL] at all!! gimme gimme gimme"? Stop posting double threads. Do some work yourself, come back with your effort and then maybe we'll help you. | |
Re: Although Adatapost's solution will compile and work, there's no reason why you should use this (ever). I would choose for an init-function that's called from the constructor. You can always call this function at a different time: [code=cplusplus] class foo{ public: foo(){init();}; ~foo(){}; void init(void); }; void foo::init(){ std::cout << … | |
Re: You're still using array, when you should be using vectors. Here's how I'd do it: [code=cplusplus] void ShowInv(vector<string> inv){ cout << "Your inventory:\n"; for (unsigned int i = 0; i < inv.size(); i++) cout << inv.at(i) << endl; } int main() { vector<string> inventory; inventory.push_back("Battle Axe"); inventory.push_back("Armor"); inventory.push_back("Sword"); ShowInv(inventory); cin.get(); … | |
Re: In addition: You should initialize [icode]textToEncrypt[/icode] with a value before asking for it's [icode].length()[/icode]. Just to be on the safe side. Also: You should check if [ICODE]argv[0][/ICODE] has a value, before passing it to ifstream to open it. then this : [ICODE]for (int x=0;j-1;x++)[/ICODE] You're telling the compiler to : … | |
Re: [QUOTE=serkan sendur;927643]even you can speak with scottish accent, so as you can understand scottish english, you can speak with all different accents in the world :) even irish maybe :)[/QUOTE] Don't mix up Scottish and Irish, they are like water and fire :) | |
Re: Here's a good [URL="http://www.daniweb.com/forums/thread63827.html"]start[/URL]. | |
Re: I think a 'C' interpreter might be a too big a challenge for a newbie. How about a [URL="http://en.wikipedia.org/wiki/Brainfsck"]brainfsck [/URL]interpreter? You could use file-acces to load source files, an array to keep track of your datapointer etc.. | |
Re: Click [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx"]here[/URL] | |
Re: [QUOTE=whotookmyname;928048] I have done the most of it...what remains is how to replace the first line?[/QUOTE] There are two options: 1. - read the original file in your memory. - delete the file - create a new file and add your line - add all the lines in memory 2. … | |
Re: [QUOTE=redman6650e;927461] I was wondering if anyone had expertise in using time algorithms[/QUOTE] Yes. [URL="http://catb.org/~esr/faqs/smart-questions.html#prune"]Someone [/URL]probably has. | |
Re: Why are you using a global variable 'stat' ? You're passing it to your functions right? So make it local to main. | |
Re: Here's a [URL="http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7"]link [/URL]for you | |
Re: You've answered your own question in your code: [code=cplusplus] //////////////////this is what she says is wrong int *arrPtr[numScores]; [/code] But you already did it the right way with "scores": [icode]scores = new int[numScores];// Dynamically create an array large enough to hold all of the test scores[/icode] So change the line … | |
Re: This: [icode]if year is divisable by 4 and year is not divisible by 100 //leap year[/icode] is not complete. A leap year is a year that's divisable by 4 and not by 100 [B]unless it can be divided by 400[/B]. Other then that, it [I]looks[/I] fine. | |
Re: And furthermore, your code isn't c++, it's C (poorly). I strongly discourage the use of system("pause") ([URL="http://www.gidforums.com/t-7105.html"]here's why[/URL]) and also fgetc and fputc. Also, if you want help, learn to use [URL="http://www.daniweb.com/forums/announcement8-3.html"]code tags[/URL]. | |
Re: [QUOTE=tux4life;923511]Some people just get assignments which aren't logical.[/QUOTE] Sorry, I couldn't resist. :icon_rolleyes: [attach]10938[/attach] [quote=Spock]That is illogical captain.[/quote] | |
Re: To stop the discussion who should start what in where: [URL="http://www.daniweb.com/forums/showthread.php?t=181085"]Here's what you're looking[/URL] for and why it hasn't been implemented. | |
Re: I'd read the file one line at a time and then parse this line to search for semicolons. [URL="http://www.cplusplus.com/reference/string/getline/"]Getline [/URL]with a delimiter should do the trick. Here's a sample: [code=cplusplus] #include <iostream> #include <sstream> #include <string> #include <fstream> using namespace std; int main(){ ifstream infile("c:/in.txt"); // for example string line … | |
Re: You do realize that [icode]conjCodis[/icode] never gets a value when you jump in the 'else' part of your code right? | |
Re: [QUOTE=jephthah;920148]... Super Moderator badge? can i have it?[/QUOTE] You've got my vote. So with the sudden disappearance of Narue, the moderators are free to do anything the want right? I mean: no control what-so-ever until there's another s-mod? I'm getting a vision of a combination of 4chan of Daniweb, which … | |
Re: [URL="http://www.dreamincode.net/forums/showtopic115955.htm"]crosspost[/URL] | |
Re: [QUOTE=Ancient Dragon;924759]You forgot to tell us what the problem is that that code.[/QUOTE] I think this post was split of from the sticky 'how do I flush the input stream' thread. So perhaps the poster was just giving some suggestions? (although it has nothing to do with flushing the input-stream) | |
| |
Re: At this point I would like to throw in a new word in the discussion. [URL="http://www.cplusplus.com/reference/stl/vector/"]Vectors[/URL]. Sorry 'bout that :icon_wink: ![]() | |
Re: [QUOTE=pywriter;920778].Just tell me how to write a heap data structure class in C++.[/QUOTE] [URL="http://en.wikipedia.org/wiki/Heap_(data_structure)"]heap[/URL] Also look [URL="http://eternallyconfuzzled.com/jsw_home.aspx"]here[/URL] And a [URL="http://code.google.com/search/#q=c++%20heap"] lazy link[/URL] If you want descent information, ask a descent question. | |
I've already mentioned this [URL="http://www.daniweb.com/forums/post744978-8.html"]before[/URL], but got no reply. I would really like it if we were able to attach pics to snippet (and blogs). Snippets for game-dev, visual apps etc make no sense at all without some pics to demonstrate what they do. | |
Re: [B]fstream [/B]is not C, it's C++. What language are you writing this program in? | |
Re: >>Reply With Quote Oh sorry; here you go: [QUOTE=meshooo007;920657] Reply With Quote[/QUOTE] :icon_wink: Here's some 'research' for you: [URL="http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html"]Beej's guide[/URL] to networking. [URL="http://en.wikipedia.org/wiki/Telnet"]Telnet[/URL] Those two links should get you started. Now try to write some code and come back when you have actually made something. |
The End.