447 Posted Topics
Re: I can just imagine iPods with casette slots in them! Ha! | |
Re: How do you know it doesn't return anything? All you know (or at least have shown us), are the prototypes. I assume it assigns a value to the int pointer 'kptr' and because its type is an int star assignment from a function must return an int star. Also, I … | |
Re: Well, no. It's not. Do you understand recursion? It's essentially another method of looping but rather than using while() or for(), for example, a function recursively calls itself: [code=cpp]void count_down( int num ) { if ( num>=0 ) { std::cout<< num; cout_down( num-1 ); // Calls the function again but … | |
Re: search google for code::blocks or devc++ ... are microsoft giving one away still? | |
Re: Not only that but for strings you appear to be using ' rather than ". While neither method will work ... Since you're using C++ you might as well use std::string rather than character arrays. Try an if-else if ladder rather than a switch. [code=cpp]#include <string> //... std::string str; std::cout<< … | |
Re: And what's the error? I'm guessing it's in the number of parameters. Pass in the size of the string (?), N too: cin.getline( N, 12 ); Or whatever size it is. [url]http://www.cplusplus.com/reference/iostream/istream/getline.html[/url] | |
Re: There must be a reason ... money, I doubt it. As csgal said - just wait a few years. Maybe a bastardised Oedipus complex? Kill grandfather marry grandmother? Maybe the ultimate rebellion from his parents/her kids (but [I]waaaay[/I] too far)? Could it have been unknown? | |
Re: I just have the one which I got a few months ago. I don't really use it much and I guess it's there just incase I need it ... and cocaine of course. How else can I break it up? | |
Re: Bet if you copied it into notepad, pasted it and copied it again it'd fix the colours. You just start the guitar? The AIM beep made me jump! | |
Re: To answer your question: no. >> PeopleTypes[i] != 1,2,3,4 Do you want it to be or, or and? OR: PeopleTypes[i] != 1 || PeopleTypes[i] !=2 || PeopleTypes[i] !=3 || PeopleTypes[i] !=4 AND: PeopleTypes[i] != 1 && PeopleTypes[i] !=2 && PeopleTypes[i] !=3 && PeopleTypes[i] !=4 Aint pretty but you'll get over … | |
Re: >> int image [ROW_SIZE][COL_SIZE]; OK. You want to display the image as characters ... do you need to keep it in memory? If you do you can either change the type of the image to a character array. It'll read in all the numbers as single characters. Then, once it's … | |
Re: Well one option would be to create an integer called 'max_value', or something. Set it equal to the first element of the array. Iterate through the entire array and test each element against the max value. If the element it bigger assign, else leave it. | |
Re: Yes. One thing you could do is create a running-sum of numbers and ask the user at the start how many numbers they want to insert, then loop that many times. After it's all looped divide by the number of iterations which were inputted. Alternatively you could read the numbers … | |
Re: I think it's amusing and interesting to read the 'secrets', but one must always remind themselves that they might not be true .... (sorry, just offtopic once more: iamthewee your PM thing is full... apparently) | |
Re: The source file itself got deleted? I'm disinclined to believe it could be the compiler ... but what compiler are you using? You certain it's gone? And that it's just not where you thought it should be. Have you searched for it? (as in the OS searches, not you) | |
Re: You used 'zealous' in your introduction. We're off to a good start! | |
Re: >> How else would sum up the total of the number the user entered? [code=cpp] #include <iostream> #include <iterator> #include <numeric> int main() { std::cout << std::accumulate(std::istream_iterator<int>(std::cin), std::istream_iterator<int>(), 0); return 0; }[/code] Only kidding :) Ignore that!! Now. >> for (num=1; maxNum=1; input++) Do you know the proper format for … | |
Re: [code]class vhand{ ... };[/code] Come on, dragon. Surely you can manage that!! | |
Re: [url]http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx[/url] is a good reference. It's in C but it describes all the concepts very well. | |
Re: Can you give us a sample main() to illustrate the problem clearly? | |
Re: I've heard it's meant to be very like 'eraser', which I didn't like so I haven't gotten it as of yet. | |
Re: String is part of the standard library so either: using std::string ; or std:: all strings. | |
Re: What won't work? People mightn't compile your code so you're going to have to give us some more info. Errors, warnings, crashing? | |
Re: You're going to need: Lemsip, paracetamol, whiskey, cloves, hot water and lemons. Being sick of programming is like being sick regularily, right? | |
Re: The Google Story is interesting, but that said I only read up to the pictures half way through because I had to read it for 'innovative invention' for a subject in uni. | |
Re: OK. First thing first. You're using C++ so you should think about using std::string rather than statically sized character arrays. Benefits - dynamically resized, memory automatically managed, public methods, easy to use operators (like equality). Downsides - you're going to have to learn them. Especially since you "#include <string>". Also … | |
Re: Do you have a memory stick of some kind? Could you download it in an internet cafe or something and transfer it to your computer at home? Or, as you suggested, a friend? College? Work? School? | |
Re: [code=cpp]#include <ctime> #include <iostream> int main( void ) { int i; srand(time(NULL)); i = rand()%200; std::cout <<"Your random number is " <<i <<std::endl; return(0); } [/code] Know how to loop? | |
Re: Use code tags. [code] bool determine_square (int& length, int& width) { if (length == width) square = true; else square = false; return square; }[/code] That should simply be: [code]bool determine(int &length, int &width) { return length==width; }[/code] In your function you make a reference to square but the scope … | |
Re: >> HI CAN U PLS HELP ME IN ADDING SOMETHING TO THIS PROGRAM TO BE LOOK GOOD. Code tags! - [noparse][code][/code][/noparse] | |
Re: Well most of us aren't mind readers here so provide some errors for us to look at. >> #include "C:\Graphics\graphics.h" replace \ with \\ Might/mightn't solve some of your problems. | |
Re: [URL="http://www.daniweb.com/forums/%3Ca%20href=%22http://www.nerdtests.com/nt2ref.html%22%3E"]Mega-Dorky Nerd King[/URL] ... damn. | |
On a freakin' [URL="http://gizmodo.com/gadgets/speed-record/hercules-hits-1307mph-on-a-bicycle-305161.php"]bicycle[/URL]!! | |
Re: They should. Nor do they make nice books anymore. I mean antique ... that sounds kinda stupid I know but they look cool. Attached below is a 150 year old version of Dickens' works which I love reading from. It's in tatters, but it's still good. It's also about the … | |
| |
Re: Did you just add some getlines? It's hard to see what you did differently. Could you maybe highlight it in your code? | |
Re: >> and whats A level math? It's a qualification - [url]http://en.wikipedia.org/wiki/A_level[/url] | |
Re: Very good find! It converts them and all... does it work OK? | |
Re: I dunno. It's always good to resurect 2 year old threads! | |
Re: Do You Always Capitalise The First Letter Of Each Word? :D Welcome! | |
Re: [B]Show an attempt. Don't double post. And don't PM for one to one help![/B] | |
Re: Don't think of a csv file as anything other than a file. You can access it and everything just like any other file (text file you mentioned). What you want to do is not hard but it requires more than appending data. The simplest way of managing this (I reckon), … | |
Re: Shouldn't use void main. getch() isn't a great way of stopping the program. iostream.h is non-standard. use iostream: [code]#include <iostream> using namespace std; int main( void ) { std::cin.ignore(); return 0; }[/code] | |
Re: I think you misread, Ancient. >> string words[6]; so there is a words[5]. ![]() | |
Re: The problem is common in mixing cin and getlines. I won't go into the explanation (it's all over the place), but I'll tell you the solution. cin.ignore() before getline(). Also please use code tags when posting code. This is an easy code-sample to read because it's so small. But it … | |
Re: [quote][code] for ( int j = 0; j < 5; j++ ) { string tmp = crap[j]; //output first and third character cout << tmp.substr ( 0,1 ) << " " << tmp.substr( 2,1 ) <<endl; }[/code][/quote] Wouldn't it make more sense to to: [code=cpp]for ( ... ) { std::cout<< … | |
Re: Sorry. I thought this was in C++ ... make an array, loop through, and sum: [CODE]int total = 0; int array[ARRAY_SIZE]; /* Fill array with info */ for [0 -> ARRAY_SIZE-1] total = total + array[CURRENT_POSITION] print "Sum: " total[/CODE] Obviously that's psuedo code. | |
Re: So you wrote the code but you don't know how to call a function ... really? That's pretty hard to believe. Just call it like how you'd call any other function and pass the appropriate values into it! |
The End.