481 Posted Topics
Re: I agree with mosaic. [code=cplusplus]int main(void){ system("notepade.exe"); return 0; }[/code] Chris | |
Re: It should be noted that using ifstream with >> operator defaults to skipping whitespace characters, which '\n' is also included in. if you want to proccess the'\n' in a special manner then you should use the following loop condition [icode]while(fp1 >> noskipws >> ch)[/icode] Not that you do not need … | |
Re: Guess what, there's only one person at this forum who is capable of getting the answer and thats [I][B][U][COLOR="Red"]YOU[/COLOR][/U][/B][/I]! Chris | |
Re: [code=cplusplus]class a{}; class b: public a{}; class c: public a{};[/code]The very short example lol | |
Re: Um sounds to be link you want something like this. [code=cplusplus] aVariable += anotherVariable;[/code] | |
Re: I'd consider reading about stringstreams and better methods of processing inputted data. [url]http://www.daniweb.com/tutorials/tutorial71858.html[/url] Chris | |
Re: You might want to shoot me before you start reading but meh lol. I use Google Chrome.....*runs* on my older PC because it's somewhat faster than the alternatives. Anyway basically drop down menu's don't work. Instead of being given the drop down menu it just redirects you to the default … | |
Re: For basic ASCII which I presume you will be using, then you can just check the character range. and swap accordingly. IE, 65-90 is capital etc Chris | |
Re: If I am correct compilers will automatically generate a default blank destructor for you anyway on compile time if non is specified. But I think it's good practise to make sure you include a destructor whilst learning about classes. If you don't you'll forget about them and when you come … | |
Re: Rebuild the debug version and it should work fine. Might I add that your first method should be run the program from the Command Prompt, rather than using cin.get(); Since they are technically supposed to be run from the command prompt...it will also allow you to see your output. Only … | |
Re: [code=cplusplus]#include <fstream> ... std::ifstream myfile("blah.txt", std::ios::binary | std::ios::in);[/code] Chris | |
Re: [I]zalezog[/I] please don't add [icode]cin.get()[/icode] to the end of people code snippets, they are not wrong by not using it. I would be more inclined to say you are wrong in using it. Chris | |
Re: What exactly is it you want to do with ctime. There isn't alot to it...and when you consider that ctime is justthe newest version of time.h that was written for C it's no wonder alot of the material out there is C based...because it's a C based header file. None … | |
Re: You are including a header file more than once, if you are going to do this you need to use #ifndef #define #endif etc etc Chris | |
Re: It's because open() expects a null terminated string rather than a string class. you can do the following[code=cplusplus]read_file.open(in_file.c_str());[/code] Chris | |
Re: [url]http://en.wikipedia.org/wiki/Magic_square[/url] Google has plenty more. Chris | |
Re: Using Win32 Development it will be platform specific. IE it will only work on M$ Windows. [url]http://www.winprog.org/tutorial/[/url] That is a rather nice tutorial on how to get started. You should also use MSDN for a reference manual if you are seriously looking at writing unmanaged Win32 Applications! Chris | |
Re: [url=http://www.catb.org/~esr/faqs/smart-questions.html]Have[/url] [url=http://www.daniweb.com/forums/announcement8-2.html]a[/url] [url=http://www.daniweb.com/forums/announcement8-3.html]nice[/url] [url=http://www.daniweb.com/forums/thread78223.html]day![/url] Chris | |
Re: eeek indent overload. Also what is the problem exactly...? We cannot fix it if we do not know it! Chris | |
Re: You'll have to gets started before people will help you. We don not do your work for you. Google will turn up some material andthe rest you should already know...such as the basics behind it. Chris | |
Re: What exactly do you mean by subset? as in are you trying to list all the different permutations of the numbers? ![]() | |
Re: Also a starting point would be nice...so we can point out where you have gone wrong. Chris | |
Re: Next question when you downloaded and installed the Code::Blocks IDE Itrust you actually downloaded the installation that comes with MinGW? Chris | |
Re: Does this have to be cross platform? You are kind of confusing me when you say 3- how about clearing the screen ??...without the use of systm("cls"), how do u thinki can write in windows? Gives the impression its just for windows. But other things say linux too... | |
Re: Since he doesn't seed rand at any point he is always going to get the same number back from it | |
Re: if you want even bigger numbers then you can always make your own number data type using a string Chris | |
Re: Or for a more reliable solution (ei for more than just ASCII) you can use tolower() and toupper() functions found in the cctype header Chris | |
Re: I think that when being class taught you are worse off. You tend to take the information you are fed and that is enough for you, you think it is correct. However when you teach yourself from books and the internet you wonder wether the resources information is actually 100% … | |
Re: Use std::string with getline[code=cplusplus]#include <string> ... std::string myString; getline(std::cin, myString);[/code]Hope that helps Chris | |
Re: When you say you have successfully assembled it, i'm asuming you now have at least one Object file. In which case you need a linker to link the object files together into and exe file. Chris | |
Re: [code=cplusplus]#include <iostream> #include <windows.h> #include <ctime> using namespace std; int main(void){ int hours = 36; int mins = 57; int secs = 58; while(1){ system("cls"); if(hours > 0 || mins > 0 || secs > 0){ cout << "Deadline in: " << hours << "h" << mins << "m" << … | |
Re: 1) [url]http://www.cplusplus.com/reference/clibrary/cstdarg/[/url] 2) Application Programming Interface - google it 4) Not a great deal, take XNA development for example.It uses C# the only differnce with developing windows applications to Xbox360 applications is that fact thatyou have to account for the different controller Chris | |
Re: It should be noted that short of speed, you really need to consider how safe fprintf is. Just remember that read chuncks of data at a time is somewhat faster than reading 1 bye at a time Chris | |
Re: Glad you got it fixed, just remember the number is the amount of array slots you get starting from 0...not what you get upto and including ps mark as solved thanks, Chris | |
Re: This is a very common question, Salems answer will be perfect for you. But you may want to have a look over some of the topics found here, since they all deal with the same problem and have many explanations of what is going on. It saves us quite a … | |
Re: we prefer to use strings with getline but there we go, it's a much more reliable solution since you don't have to worry about size[code=cplusplus]string test; getline(cin, test); cout << test.length();[/code]Chris | |
Re: It's down to you to check the state of the shift key and caps locks. So i suggest you do that :P Chris | |
Re: Perhaps you should read the entire file in, strip out all html tags as you do so, that way you are left with just text. The go over and process what you have for sentences. But as ddanbe said, this isn't really a job for C++ The closest you will … | |
Re: 2D enough for you?[code=cplusplus] vector< vector<int> > v; for(int i = 0; i < 10; i++) v.push_back( vector<int>() ); for(int i = 0; i < v.size(); i++){ for(int x = 0; x < 10; x++){ v[i].push_back(x*i); } } for(int i = 0; i < v.size(); i++){ for(int x = 0; … | |
OK, I've been looking at templates recently and eveything was fine...never had a problem with them at any point. But then when I decided to write a function that would either return the given template type or not. the following code explains what I mean.[code=cplusplus]template <class T> T find(char x, … | |
Re: Just a stab, when you move do you redraw the gun? cause you will need to. Chris | |
Re: [url=http://www.letmegooglethatforyou.com/?q=Generating+Permutations]Chris[/url] edit: just add one to the number lol and loop through?? | |
Re: Seems wird it should work fine. Try clicking re-build Chris | |
Re: Flag this for move...or move it now! please :DDDD @OP: read the rules about posting please Chris | |
Re: wouldn't it have to be[code=cplusplus]Rules[this->RuleNum]->min->MembraneOut[0]=A.min.MembraneOut[0]; [/code] Chris | |
Re: Dive into C++, and get googling for C++ tutorials. [url]http://www.cprogramming.com[/url] [url]http://www.cplusplus.com[/url] Some starting links Chris | |
Re: Read all of the questions into a vector, which is simple enough just takes one loop. Then you can append to the vector and you can remove items from the vector. Then before quitting besure to clear the text file and re-write everything stored in your vector! Chris | |
Re: There is no need to rate yourself. Your talent comes apparent quite quickly and users will help feed that. you might want to think about following a few tutorials and getting a reasonable understanding of the language before trying to join projects. As they mostly consist of people who know … | |
Re: Firstly you should use [code=cplusplus]while(getline(myfile, line)){}[/code] rather than [code=cplusplus]while(!myfile.eof()){}[/code] this is because eof() can return true before the end of a file with some excape characters. Secondly look into the vector header its wonderful its designed with this sort of thing in mind! Chris | |
Re: pass an array to it and let it edit that arrays data |
The End.