3,892 Posted Topics
Re: Knock knock... do I see somthing missing... #include <cstdlib> #include <iostream> #include "Look.h" using namespace std; int currPos = 0; int checkFlag = 0; static int shipPos1 = 0; // default start position (pos 0) int shipPos2 = 228; // 3.80 minutes (228 seconds) Look::Look() { } Look::~Look() { } … | |
Re: Okay to put it in a simple way, the round bracket syntax is used when you want to initialise the primitive data type varibles in your class with their defalut value while you ignore the brackets you just get an uninitialized object. [code=cpp] class My { public: int a ; … | |
Re: Please be a bit more specific, since this is nor pure C++ but SDL mixed along with it, and also due to the lengthy code it becomes difficult for us to pin point the problem. What exactly happens, does the ball go through the bricks, what do you mean by … | |
Re: [quote=happygeek;272812]An introduction to what, or whom for that matter?[/quote] He wants to know about you :mrgreen: | |
Re: Tsk tsk... nowadays everyone wants to be a shaman, resurrecting dead threads...... Thread closed. | |
Re: Deleting dynamically allocated array is done in C++ using the special delete syntax : [inlinecode]delete[] array_persons ;[/inlinecode] where you had allocated the array with something like: [inlinecode]int* array_persons = new int[10] ;[/inlinecode] An eg. [code=cpp] int main() { int* a = new int[10] ; for( int i = 0; i … | |
Re: 1. First of all main returns int so your prototype should be [inlinecode] int main (void)[/inlinecode] with a [inlinecode]return 0[/inlinecode] at the end of the program. 2. You wanted a square of * but you ask the user two parameters width and height , so do you really want a … | |
Re: Firefox for me. (with all the extensions available on the net, I can make a godly browser out of it) | |
Re: Hmm.. if you want to code this thign from scratch, you need to use some socket library. (like winsock for windows) Maybe looking at this thread would help a bit: [url]http://www.daniweb.com/techtalkforums/thread50205.html[/url] Hope it helped, bye. | |
Re: Done and done. Also posted a touchy comment which would make their eyes water *sniff sniff* Hehe. Glad I could help. | |
Re: Hmm... what happens if the capacity of array overflows ? You state in your problem statement that the function returns -1 if the inserted element causes the array to have more than max elements , but still in your eg. you return 1 ? Post two or three egs. specifying … | |
Re: [quote=Chaky;272646]I guess it's the story of my life. Always at the end of the line.[/quote] Just wanted to quote two things: [quote]With great powers comes great responsibility[/quote] [quote]The grass is always greener on the other side[/quote] Regards, ~s.o.s~ | |
Re: Hmm.. a palindrome actually doesnt consider spaces, punctuation marks and character case (upper or lower). Maybe for a more detailed explanation, you might want to look here: [url]http://www.daniweb.com/techtalkforums/thread59789.html[/url] | |
Re: Wow that sure is some dream. BTW do you really have a girlfriend or even that was a part of your dream :D | |
Re: Maybe you should read this. [url]http://www-ccs.ucsd.edu/c/time.html#clock[/url] As far as the measuring of time is concerned, you can start the timer or measure the value of the clock at the start of the event and then query the time again when you want to know how many ticks has elasped. [code] … | |
Re: In the project settings have you set the path for the header and library files of your SQL library ? | |
Hello to all geeks out there, i was just wondering which scripting language out there is capable of achieving everything a scripting language is supposed to do. I know there is no such thing as "best" in software development circles but just wanted to know from all the experienced people … | |
Heh people, finally I have been struck by P1K ... oh I mean I have completed by 1000 posts on Daniweb. Feels good. :mrgreen: With all your members, moderators, super moderators and admins support and friendship, I have in just 5-6 months.. [LIST] [*]reached 1000 posts, [*]5 dot reputation and … | |
Re: My List: Iron Maiden Theory of a Deadman Incubus Papa Roach and lots more but the favourite is :::: IRON MAIDEN !!! | |
Re: [quote=linq;272111] [CODE]string strd1 = "9"; int m=atoi(strd);[/CODE] Got the error: error C2664: 'atoi' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *' how to change the second line to make it work?[/quote] [INLINECODE]atoi [/INLINECODE]doesnt accpet a C++ style string but a C style string … | |
Re: Hmm.. hey [B]benobi1[/B] and [B]cosmoe[/B], just to let you know that even though this is geeks lounge, it doesnt mean that you start posting utter crap, irrelevant to the thread which is about Miss Dani's birthday. Either stick to topic otherwise dont post. And let Miss Dani worry about her … | |
Re: You actually wanted num_string as char array( C style string) but have declared it as being char which will hold only one character. [code=c] char num_string = '\0' ; // wrong char num_string[BUFSIZ] = {'\0'} ; // correct, will now hold a number string [/code] Also can you give a … | |
Re: Code::Blocks for small projects and Visual Studio for large projects. | |
Re: [quote=may4life;271529] [code] void MYFUNCTION(){ } [/code] [/quote] Now I would really like to know who writes functions that way !!!:eek: | |
Re: C for me, C code can be called from Python, Perl and many other languages. COupled with GUI features of Python and the modules demanding performance in C, try to beat that combo. | |
Re: [quote=iamthwee;271505]Don't forget to use the header #include "very_small_violins" then.[/quote] Oh what the hell, this is the joke of the century :mrgreen: Keep it up Mr. Iamthwee | |
Re: The reason you are not able to find the damn problem is because the way your winner function is designed. A function which spans almost 3 pages in C++ has some serious design problems. Try splitting the function into logical componenets, maybe that would help you localize the problem. Since … | |
Re: Hmm anyone heard of Ragnarok Online. If no then I play that game and if yes then hmm.. (what is the level of your character ;) ) | |
Re: [quote=batista06;270974]I'm trying to turn this part into a function into my code[/quote] But where is the function in your code ... I dont see it. Post the updated code. | |
Re: [quote=niek_e;270739]I agree that this isn't the easiest subject for a beginning programmer, but I'll try to explain: so you can just use 'coordinates' to set and get data! For example if you say: [inlinecode]array[2][2] = 1 ;[/inlinecode] You array will now look like this: 000 010 000 [/quote] Oh so … | |
Re: [quote=iamthwee;270884]What's wordstream.h linkedlist.h? Please label which one is which for clarity[/quote] I think he hasn't posted those files. | |
Re: [quote=easy;266044]run the in a command prompt then ull be able to see all the output before it quits. or try placing [inlinecode]system("PAUSE")[/inlinecode] before the return statement, but i think thats bad practise to do that[/quote] Correct . Its bad practice to use system calls to achieve such a trivial function. … | |
Re: Hmm anything for a good friend... Done and done. It would be better if you pasted your request in your signature, that way more ppl will vote for that. PS: BTW who is the girl Lauren ;) | |
Re: Okay the thing is that your code doesnt even compile. I thought maybe you had "some problem" with the code ? The mistakes were all silly ones os i have just changed them and the y are given in red... [code] [COLOR=DarkRed]// #include <iostream.h> depreceated header style use the one[/COLOR] … | |
Re: Why dont you declare each and every variable as double, that way you can do away with the cast. Also initialize the var at declaration to avoid confusion and using the values before they are defined. | |
Re: Search engines are your best friends: [URL="http://www.google.co.in/search?hl=en&q=tree+graph+data+structure&btnG=Google+Search&meta="]Google[/URL] [URL="http://clusty.com/search?input-form=clusty-simple&v%3Asources=webplus&query=tree+graph+data+structure"]Clusty[/URL] ![]() | |
Re: To get around this problem, try placing the literal value before the variable while comparing. Something like: [code=c] while( true == check ) // here if you make a mistake of using an assignement operator // an error will be flaged[/code] | |
Re: Naa you aint defining the default constructor, you are just declaring it in Complex.h but its defination doesnt occur in Complex.cpp, thats the whole root of the problem. Implement one in complex.cpp and all should work out fine. | |
Re: Hmm... are all the files in the same folder ? Have you checked the project settings of visual studio for this particular project ? | |
Re: Okay lets put it this way: [LIST] [*]You need an output like:[/LIST][QUOTE] 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 [/QUOTE] [LIST] [*]Notice that the ending number of each line keeps on decrementing each … | |
Re: Arent the comments clear enough to make so that you can yourself do the documentation ? | |
Re: Hmm.. i am not sure that i have got your question but: [code] int main( void ) { char name[BUFSIZ] = {'\0'} ; printf ( "Enter the string: " ) ; fgets( name, BUFSIZ, stdin ) ; int i = 0 ; for( i = 0; i < strlen( name … | |
Re: [quote=mandanainred;270178] I as it becomes a double , I cant use % with the double. and [/quote] Just to let you know there is a function there is a function [search]fmod(double x,double y)[/search] which exactly does the same thing. But as Mr. WaltP has already pointed out, dont use double … | |
Re: When you say, it doest work, it is very vague. Sifting through someone else's code is really difficult. Since your program is written in modular way, say which parts work properly and which dont. | |
Re: Show us what you have got so far and we will definately help you out. | |
Re: Try replacing [INLINECODE]#include <asm/io.h>[/INLINECODE] to [INLINECODE]#include <sys/io.h>[/INLINECODE] and tell me what you get. |
The End.