481 Posted Topics
Re: [QUOTE=666kennedy;751535]im trying to show what is stored in arrays, basically to make sure my program is working fine, i have got it to print which element in the array it is, but how do u access the array and show what value is stored in it. my code is basically … | |
Re: loop throught all the elements on the stack, check what it is either ()[]{} and use 3 different boolean values, 1 for each brace type ie 1 for () 1 for [] and 1 for {}. then toggle states...if that makes sense and if the state wouldn't chage then you … | |
Re: Well what idea's do you have for writing a jump function. I guess you would have to think about a couple of things, What exactly is your motion path when you jump, how the direction of movement before hand effects the mothion path of the jump. Also you would need … | |
Re: Count your brackets srand((P1Cards[i])time(0)); srand((CompCards[i]time(0)); Chris | |
Re: [URL="http://www.daniweb.com/forums/thread78223.html"]BOOM![/URL] Chris | |
Re: Um, by wierd output do you mean un sorted. Cause i have a strange feeling (unles si missed something) that you sort (or at least try to) the array list....which is just discarded once your sort is completed. You need to pass by refrence... using the & operator in your … | |
Re: Perhaps this is relevant? [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.menuitem.break.aspx[/url] Chris | |
Re: [URL="http://www.letmegooglethatforyou.com/?q=Sorting+Algorithms"]I have no idea how sorry i can't help[/URL] I'm such a kinda man......after that title | |
Re: When is the problem, unexpected out put wtc. We cannot judge what you have done incorrectly if you don't tell us how it is wrong Chris | |
Re: Use code tags please [noparse][code=cplusplus][/code][/noparse] Also what exactly is the problem? Chris | |
Hi, i'm doing some work with double atm and i have what appears to be a simple expression. When i work this out in my head i get the answer to be 0. However running the code gives me a very obscure value -5.77338e-017 Any help as to what i … | |
Re: Hmm quick suggestion probably a crazy one :D does this work static void Test2(list &tester) | |
Re: You can just do the following [code=cplusplus]if(line[0] == '<' || line[0] ==' '){ //some code }[/code] Chris | |
Hi all, i'm looking into doing a little bit of work with the mouse in console applications on windows. I'm using windows.h to get access to functions such as ReadConsoleInput. I've created a simple program that just prints a string whenever the left most mouse button is clicked. However sometimes … | |
Re: [code=cplusplus]string myString; getline(cin, myString);[/code] Chris | |
Re: Note you can use find() or find_first_of() etc to get the index of the character youare after. Chris | |
Re: Before you do the above, migrate to the C forum Chris | |
Re: Could you use EmulateKeyPress() after that to send a backspace to it? Chris | |
Re: This looks to me like you are going to be going into threads and mutex. You should have a good look on google on how to use threads. You could spawn a new thread to control the Opponents attacks, since they require no user imput all that would be happening … | |
Re: I personally would use a string... [code=cplusplus]#include <string> ..... string myString; cout << "Enter a number\n>>"; getline(cin, myStrnig);[/code] And then you may want to readinto the cctype header, which will give you some useful functions like isdigit(). Chris | |
Re: Yes there is it's pretty simple too [code=python]mylist = ['blue', 'red', 'green', 'green', 'red', 'red'] for word in set(mylist): print word, "appears", mylist.count(word), "times."[/code] Hope that helps. Chris | |
Re: [QUOTE=SlayerX;745667]oh..thx guys.....but i still cant do it....need some beginning codes...as u know im still beginner....well..hope u can help me thx!![/QUOTE] You are NOT going to get a code solution. Either give in trying or post what you think you should be doing in words, pseudo-code or some method of displaying … | |
Re: Infraction did say it was a rough idea, not the exact code to use. Also the ifstream takes C Strings, the function c_str() isfound in the string header and converts string object to C Strings, incase you were not aware of this. Chris | |
Re: [QUOTE=StuXYZ;745857]I think that the problem is that section is a char array and you have the problem that you have to convert them to integers first, otherwise they have their ascii value. e.g. 1 is 49 (I think) So isolate the number part of section and convert to an integer/double … | |
Re: Before you take a tutorial in dreamweaver which is a very good choice. I would reccomend learning how to post a question. For starters this is a web design question NOT a Java Programming Question. So why is it in the Java Topic? I would also reccomend that you have … | |
Re: to seed the random number with srand the *best* method is as follow. [code=cplusplus]#include <ctime> ... srand(time(NULL));[/code] Note you only need to seed rand once in your program. Chris | |
Re: Your gonna need to provide alot more information. For example what are you programming exactly..some kind of mirco controller. Each micro controller is different and the dll file you have been given will vary for each also. So it is not so much a C++ question. It is more a … | |
Re: You need to tell your Compiler/Linker to include them in your project Chris | |
Re: The logic behind the memory is not too complex. At the start of the game Create a list containing all of the sequence. And then compare the button press with the value in the correct list position. for example the first button press should be equal to the value stored … | |
Re: Have you ever read about strtok? [url]http://www.cplusplus.com/reference/clibrary/cstring/strtok.html[/url] Chris | |
Re: Java-o-matic has some video tutorials, not much though Chris | |
Re: call me silly but why not just send the data straight to the correct file name. Also i would recomend you do all file copying in binary mode to prevent loss of any data. Chris | |
Re: VC++ Use "CLR" Which is managed code, using MFC wrappings etc. But it does support ISO / ANSI Standards well and is a good compiler. Grr i hate to think of Dev being dead can everyone stop pointing it out lol Chris | |
Re: could you not use a Hardware clock to do the timing for you? Chris | |
Re: Post all of your code & all of the error log please Chris | |
Re: Having an ascii game that uses a GUI inventory just screams confused at me. Chris | |
Re: You really need to get your head around the logic, lets say (since im guessing you are using a 2d array for your board) your board is arrange something like this small scale - - - - - - - - - - - O - - - x O … | |
Re: [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/strtol.html"]This[/URL] may help you out with converting string literals to numbers. Chris | |
Re: Spawn a thread to count two seconds, after that make your tread force '\n' into the keyboard buffer and there you go Chris | |
Re: If you have to implement a quicksort, then i suggest you do. Have a read [url]http://en.wikipedia.org/wiki/Quicksort[/url] | |
Re: Start of by giving us an example of your code. So we can see where you are going wrong. Also pointing us to the bit you think is the problem would be good. | |
Re: or if your prefer, [url]http://www.bloodshed.net/devcpp.html[/url] | |
Re: usethe string header so you can get the path from the user then pass it to chdir like this [CODE=cplusplus]chdir(path.c_str());[/CODE] Chris | |
Re: [QUOTE=localp;732485][icode]return (str[29]);[/icode] but no use still errors[/QUOTE] thats a char your returning, still not a char array. | |
Re: [QUOTE=faisaly;732351]Considering the given code as an algorithm calculate the time complexity of this code. #include<iostream> #include<stdlib.h> using namespace std; int main(){ int i, j, n; for(i=0;i<n; i++){ for(j=0; j<n; j++){ cout<<"my time complexity is = "<<i*j<<endl; } cout<<"complexity is increasing"<<j<<endl; } system("pause"); return 0; }[/QUOTE] Code tags please [code=cplusplus][/[TEX]][/TEX]code]. Also … | |
Re: You should check how to use If & Else stantements, you have [CODE=cplusplus]if(standarddeviation>0){ cout<<"standardeviation: "<<standarddeviation<<endl; else cout<<"standarddeveiation not valid."; }[/CODE] This is wrong due to bracket positioning it should be [CODE=cplusplus]if(standarddeviation>0){ cout<<"standardeviation: "<<standarddeviation<<endl; } else{ cout<<"standarddeveiation not valid."; } [/CODE] | |
Re: Im guessing you mean in relation to realy time, you may want to use CLOCKS_PER_SEC to get things in terms of time and in terms of time to clocks for example divide clock()/CLOCKS_PER_SEC withh give you how many seconds, etc and if you want to wait for x seconds do … | |
Re: Trying doing 9.0/5.0 rather than just 9/5 Chris | |
Re: Firstly NEVER use void main() always int main() (of some variation). Secondly do you know how functions work? [code=cplusplus]void selectionSort(int onestudent[], int x);[/code] What is that doing inside your main method? [code=cplusplus]void selectionSort(student onestudent[] , int listLength); void selectionSort(student onestudent[], int listLength){ for (int i = 0 ; i <= … | |
Re: without the function call aswell it is hard to see what the problem is. Chris |
The End.