- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 4
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
42 Posted Topics
Re: [B]Try this, the minimalist![/B] [CODE]#include <iostream> using namespace std ; void main() { int response; int choose; int num1, num2 ; do { system ("cls") ; cout << "Enter Two Numbers: " << endl ; cin >> num1 >> num2 ; cout << "Do you want to: " << endl; … | |
Re: Use a loop, compare each character with space and increment a variable "temp_count" each time a character other than space is encountered. when space is met, compare "temp_count" with another variable "count". if temp_count is greater than count, assign count = temp_count and reset temp to zero to check other … | |
Re: 2726 lines just for tic tac toe ?! man you gotta be kidding me. i have one in c++, less than 150. get real dude. | |
Re: [QUOTE=WaltP;1419149]And your question about this poor code is... what?[/QUOTE] hi...why is the code poor? i mean, i didn't even know we could shutdown the pc using c. can u please tell me a (better) way? Thanks | |
Re: im schizophrenic...... can i lick my ass? | |
Re: 0111010001101000011010010111001100100000011010010111001100100000011000010111011 1011101110111011101110111011101110110011001100110011001100110011001110101011101 0101110101011011010110110101101101001000010010000100100001 | |
Hi I came across this question in C++ Primer by Stanley Lippman. [CODE] int main() { const char ca[] = {'h', 'e', 'l', 'l', 'o'}; const char *cp = ca; while( *cp ) { cout << *cp << endl; ++cp; } } [/CODE] According to me, this code should produce … | |
Re: ^ Is Indian...(me too...YAY) < Is Schizophrenic V Is a Time Killer.. | |
Re: 73 571 235 472 239 066 586 495 598 010 130 648 530 944 | |
Re: [QUOTE=Adak;1450601]What have you tried? With linked lists, it's best to study it, and have a good sample program that you know works, to refer to while you are troubleshooting your own program. I would either refer to your class/book notes on it for this, or grab a none good program … | |
Re: oh come on, it cant get any simpler than [URL="http://www.cplusplus.com/reference/std/new/operator%20delete%5B%5D/"]this[/URL]. Just refer to the code snippet given, you should do fine | |
Re: nothing weird in my compiler; just got a simple textbox saying hello world. used visual c++ 2010. | |
Re: i would say that is a very poor code. you're missing the indentations, and the code is not generic as it doesn't follow the conventions. its hard to understand for any other programmer. you can IO using classes and objects as in your case. follow this code and you'll get … | |
Re: data structures organise data and store it in an efficient way. You don't want data to be cluttered and disorganised, do you? also, we want to make maximum use of disk space and we also want the data access time to be as low as possible. But both of these … | |
Re: One, i don't get the question? What does the program do? and two, do you seriously want us to do your work? Work on the question, post the code and we'll try to rectify. That's the real purpose of the forum. Hope you get it. | |
Re: [QUOTE]It was spam anyway. [/QUOTE] I don't get it. The program worked fine with me, and it's got no main(). | |
Re: Size of a pointer in c++ does not vary with datatype, as it's just a pointer pointing to a memory location. For a 32-bit system, i guess it's 4 bytes. | |
Re: That was cool. But you know what, it would be super cool if u explain the code too, because i have a doubt that even you can understand that. | |
Re: [QUOTE]Turbo C is a dog that's had its day. [/QUOTE] does that mean i should just concentrate on programs in Visual C++, or just C++ for instance? | |
hello people...Im new in Daniweb. pursuing bachelors in IT and looking forward to learn a lot from these forums. Gotta be the best to beat the rest. | |
Re: do you want to print the values stored in array? u can use a loop like [CODE] for( int i = 0; i < 20; i++ ) { cout << "Location: " << i << " and Value:" << array[i] ; } [/CODE] | |
Re: Hey Al, welcome to Daniweb. I'm new here too any already started learning. cheers | |
Re: You should have followed alexchen's code. Try to keep the code as simple as possible, using fewer variables and cout. [CODE] #include <iostream> using namespace std ; void main() { int response; int choose; int num1, num2 ; do { system ("cls") ; cout << "Enter Two Numbers: " << … | |
Re: [QUOTE=flasp;1409547]Done that, and doesnt come up with correct result.. I hope someone can help me with making the code?[/QUOTE] I have the code but won't post it unless you show what you tried. Come on, just give it a shot. | |
When we define an array, we have to declare its size before the program can be compiled. How can we specify it's size, say, by inputting a value from the user. I know a way with pointers; any other way? | |
Re: You can use a loop to make a Fibonacci Series. Its like: 1 1 2 3 5 8 13 21 etc. i.e. next value in series is sum of previous two values. You may input the number of values the program should print from the user. | |
Hey.. Can anyone suggest me must do projects in c++ so that i can become used to it a develop a little confidence. Small games, apps would be appreciated. | |
Re: Use push() and pop() operations to insert and delete elements in stack. once you use them, u will be able to print elements of stack. | |
Re: hello...try this 1. suppose i input a character. the compiler cannot store character as integer. ERROR i stored in char a variable input and converted it into integer using atoi(). it returns 0 for all character values. hence no need to use isdigit(). [CODE] #include <iostream> #include <stdlib.h> using namespace … |
The End.