- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 54
- Posts with Upvotes
- 52
- Upvoting Members
- 38
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- Programming, Electronics
481 Posted Topics
Hey, im having a problem retrieving information about some files due to the fact either the file name or the extension is too long. For example i want to retrieve the size of a file only i call [CODE=Python]os.path.getsize("somelongfilename.txt")[/CODE] Note that it may not be a .txt extension, but it …
create a list of which characters have been hinted and check the new hint doesn't match any of the previous. You can also limit people to X amounts of hints too Chris
Firstly, don't use sysrtem. use the function given to you by AncientDragon. Secondly for an example, read the page it has a link to one. Thirdly, that page tells you what parameters are needed, what they could be and what they do. Also it tells you what headers you need …
I think you're confusing people with the use of the word bit
[QUOTE=AHUazhu;759197]cout.flush ????[/QUOTE] This is a discussion about flush the INPUT buffer....so this is a completely pointless post, before making a suggestion at least make it a viable suggestion Chris
Hi Fruit Punch, Welcome to DaniWeb :). Without any of your code as a starting point it is very difficult for us to give you a direct answer, but we prefer to give you the information you need to get your results anyway! @cool_zephyr's approach will work, however it is …
What do you mean by 'Text'? As in an editable text control? or just writing painted onto the windows? there is a big difference. Chris
Whats the exact error, thats the easiest way :) Chris
On windows the following code will move the mouse cursor.[code=cplusplus]#include <windows.h> int main(void){ SetCursorPos(50, 50); return 0; }[/code]Of course you will want to play around with that. If you want more detail just ask Chris
Hate to tell you this, but they don't exist in C either. Chris
Can i suggest you store the value of BM outside of the structure and store it in a char array of size 2 then write each one to the file before calling write() on the structure. Chris
Does w3schools even mentiod Java as far as im aware its a web programming site. Link number 5, didn't you read responses to this thread that suggested you do [I]not[/I] use an IDE like NetBeans. Read the sticky at the top and get started, a good link is [url]http://java.sun.com/docs/books/tutorial/[/url] Also, …
In reply to your question bangor boy, [CODE=java]public void showFeelings(int howManyGoals) { switch (howManyGoals) { case 0: case 1: case 2: System.out.println("Oh dear, not very good"); break; case 3: case 4: case 5: System.out.println("Ive seen donkeys shoot better"); break; //and so on } }[/CODE] Also why is your name Bangor …
Can I draw your attention to this snipped post by [I]Narue[/I] in the input stream clearing thread [code=cplusplus]#include <istream> void ignore_line ( std::istream& in ) { char ch; while ( in.get ( ch ) && ch != '\n' ) ; }[/code] Chris
[code=cplusplus]#include <iostream> #include <windows.h> using namespace std; int main(void){ bool updown = false; while(1){ if(!updown){ for(int x = 0; x < 100; x++){ for(int y = 0; y < x; y++) cout << endl; cout << " .---. "<< endl; cout << " /__\\__\\ "<< endl; cout << ".---------------."<< endl; …
Lucy, What Adak is suggesting is that rather than us telling you the bet way to do things you should research the algorithm, see what searches are a possibility then decide whether you want to be CPU intensive or stack hungry. You make some descisions about it, try and write …
A combination of modulus division and normal division will do this nicely for you. You have way to many steps, you can retreive each number in 1 line of code using both normal and modulus division. its all to do with 10^x in a way xD Chris
 
 Just to pop in as a reality check. Simple user input guessing game and such are simple to achieve and C++ perfectly capable. If however you are wanting to look into something not text based and a using graphics....more like a modern game for example Call of Duty. Then you …
Do you understand how to work with file streams? Do you understand how to implement a pow method? Either your own or the existing one?
You can define a class wide variable within your class. [code=cpp]class myClass { private: myStruct mS*; }[/code] Which will allow you to access mS in both functions, so you could allocate the memory to it in one function. Use it in a second function and then deallocate it in another …
I dislike vsc++ but there we go. I just compiled it on MinGW with no problems what so ever, i was presented with a list of the address that your data was stored at. if you want the data to be printed you will need to use **it not just …
@CppBuilder I'd recommend getting an upto date compiler. You might find that they work properly then ;)
@tintin, Recommending the use of a recursive solution is rather an obscure method of helping someone out. Since everyone knows that a recursive function isn't exactly the most efficient solution by any means, although in normally provides a neater looking solution that is easier to code. 99 times out of …
No, if its type BO then it will be BO.m, if its type DO (derived object) then it would be DO.m But when a destructer is called, it would execute D constructor first (i beleive this is the order) then B destructor. The M method in the derived class masks …
don't use eof() use file.is_good(); Also, the reason you are getting random numbers is because you don't initialise your array. [code=cpp] int count[N]; [/code] becomes [code=cpp] int count[N] = {0}; [/code] The reason it prints after everyline is because you call your function for each line, and it is your …
What is your problem?
alisn you should start up your own thread rather than reviving old threads. [code=java] System.out.printf("%1$10d%2$11.2f%3$10d%4$11.2f\n", i, QQ, d, inventory); [/code] Chris
[code] JFileChooser jfc = new JFileChooser(); jfc.setDialogTitle("My Title"); [/code] Chris
Luke you are assuming the use of VC++, it might be unmanaged C++ he is using. Rather than passing what type of connection you wish to check, you should be passing a pointer to a data structure to hold the different connections that are avaliable to you. So you should …
Have a read of the fisher-yates shuffle or perhaps the durstenfeld algorithm for shuffling. Chris
Singh, Please do not hijack other peoples threads. I suggest you read the forum rules as you have just broken most of them. You're first post was a very bad one. I suggest you read and try again in a more suitable way. Regards, Chris
do not use eof(); Do this instead. [code=c++] while(getline (openFile,line) != NULL); { cout<<line<<endl; } [/code] Chris
[code=regex] ([a-zA-Z\. ]+,)|([a-zA-Z\. ]+<[a-zA-Z\., ]+(<[a-zA-Z\.,< ]+>)*>+[ ]*,) [/code] Does that help? Chris
Compare your code with that of ancient dragon, and study them hard, you will soon see what he is doing differently to you. Until you have had a good hard look and have some sensible suggests please stop posting loads of code that means nothing. Regards, Chris
I already gave you a solution in a C++ thread. Why do you keep cross-posting?
Please don't drag up 2 year old threads. And it should be noted that in standard C++ no there is not a way. Chris
please use [noparse][code=c][/code][/noparse] tags to post code, also please come to us with a specific problem, rather than asking us to program you homework
Using the stdlib.h header in conjunction with the time.h header you can generate pseudo-random numbers which will allow you to select a random fortune cookie. [code=c]#include <stdlib.h> #include <time.h> int main(void){ srand( time(NULL) ); // seed the random generator, with current time, making it a different seed when run each …
My advice, do not use eof() it's counter productive. Instead do this. [code=cplusplus]while(getline(file, someString)){ //yourcode }[/code] Chris
Your asking for a full code solution to your assignment? I think you may be going wrong there Chris
Please use code tags! Amen to Salem being a bot ;P You posted it everywhere...pretty lame lol. What amazes me is how you managed to come up with code for permutations, but cannot write what appears to be a simple loop.... Chris
1) Read the rules. 2) Search the forums 3) Show code attempts
Should be [icode]iostream.h[/icode] and you should be using [icode]std::cout[/icode] Chris
try using isCharacter(), .charAt() and .length Chris
The following code snippet can be used to convert a decimal integer into any base from 2-16. This is a simple piece of code and I hope t proves useful to people. I see many people posting Decimal to Hex. or Decimal to binary, non any better than the next. …
This is a sample code snippet of a quicksort that uses templating and function pointers to allow the user to sort an array of anything from numbers to strings to structures. The idea is, that the coder writes a small function thats return type is bool, It should return true …
This snippet can be used to convert from bases between 2 & 16 to base between 2 & 16. This is an extension on converting decimal to any base snippet found here: [url]http://www.daniweb.com/code/snippet1067.html[/url] (By no means is this the best method of doing this, but provides rather a nice way)
int main() is not a choice, it's standard! Don't make people start ranting. Also iostream.h shouldn't be used either, there are a whole host of reasons....and Borland is out dated! Also you really do need to free the memory! If you don't do it then people using the snippet wont …
I think you should look at all of your brackets, most of your classes are contained within the PreviousButton class or whatever it is called, so get counting :) Chris
The End.













