921 Posted Topics
Re: Your way off :) First of all you can't access a variable outside of its own scope, you are using the variable [B]i[/B] in the function [B]mystrlen[/B], though it was created in the [B]main[/B] function. If you want to make the function [B]mystrlen[/B] return the length of [B]ptr[/B], simply loop … | |
Re: Now that i've had a better look at what you've got sofar, a way I think you could go about fixing this problem is by using the [B]WM_ERASEBKGND[/B] message. By doing that all the notepad windows will be painted perfectly. However, you are going to have to manually paint [B]only[/B] … | |
Re: After 10 posts, have you still not figured out that your supposed to use [URL="http://www.daniweb.com/forums/thread93280.html"]code tags[/URL] here?.. | |
Re: Start by making a program that will at least compile, anything is better than nothing.[CODE=CPLUSPLUS]#include <iostream> int main() { return 0; }[/CODE]Now, heres an example of how to convert a single variable to MPH using the formula given.[CODE=CPLUSPLUS]#include <iostream> int main() { double KPH = 50; double MPH = KPH … | |
Re: First of all, don't use [B]void main[/B], theres just no need, and main always returns [B]int[/B]. If I understood correctly, I think your teacher wants you to make a simple loop to display the characters 10-12, without cycling through the rest.[CODE]#include <iostream> using namespace std; [COLOR="Red"]int main[/COLOR]() { char test[15] … | |
Re: Careful with [B][url]http://www.penisland.net/[/url][/B], change it to [B].com[/B], and you've got yourself a problem ;o | |
Re: Whats with the sudden upsession of farts? :D ;) | |
Re: be thankful :) , email subscriptions don't even work for me ;o | |
Re: Would you mind posting the entire code?.. | |
Re: Haven't done .NET in a hell of a long time, but doesn't it go something like this? [CODE][DllImport("[COLOR="Red"]DLLNAME[/COLOR].dll")] static extern void [COLOR="Red"]FUNCTION_NAME[/COLOR]([COLOR="Red"]PARAMS[/COLOR]);[/CODE] May not be right, but I hope this helps. | |
Re: Perhaps read the text from the text box into a string, and use [URL="http://www.cplusplus.com/reference/iostream/stringstream/"]std::stringstream[/URL] to break it up. | |
Re: Perhaps if you had read the rules and used code tags, I would be a little more encouraged to help.. [B][URL="http://www.daniweb.com/forums/thread78223.html"]Read This Before Posting[/URL][/B] | |
Re: [QUOTE]I always wanted to know this; Where does space end, and if it does not end, where does it go?[/QUOTE] You can't think of space having an end. Imagine people haden't discovered that the earth was round, and somebody decided to go for a VERY long walk.. and eventually finds … | |
Re: If you have to write your own square root function, I would recommend the [B][URL="http://en.wikipedia.org/wiki/Babylonian_method#Babylonian_method"]Babylonian method[/URL][/B]. | |
Re: Well, considering that im 15 years old and have been coding since about the age of 12, don't have a job and am free to do pretty much anything I want :D I code when I have nothing else to do (or feel like it), so I woulden't say it … | |
Re: I managed to make the code compile free of errors and warnings, here are the changes I made.[CODE]#include<iostream> #include<string> #include<sstream> #include<winsock2.h> [COLOR="Red"][B]#include<ws2tcpip.h>[/B][/COLOR] [COLOR="Red"][B]#pragma comment(lib, "Ws2_32.lib")[/B][/COLOR] using namespace std; struct addrinfo hints; //fill your host info - hints is input struct addrinfo *results; //gets your host info - results is output … | |
Re: [URL="http://www.universetoday.com/2008/09/20/helium-leak-forces-lhc-shutdown-for-at-least-two-months/"]http://www.universetoday.com/2008/09/20/helium-leak-forces-lhc-shutdown-for-at-least-two-months/[/URL] | |
Re: This to me seemed like quite an interesting idea, so I had a go at it. The only real problem I had is painting problems (which can probably quite easily be sorted out). This sample program will assume that [B]notepad.exe[/B] is already open before this program is executed. It then … | |
Re: [QUOTE]i think you should try including iostream too. [/QUOTE]No need, theres no references to anything in [B]iostream[/B] yet. | |
Re: On line 47, you try to use the member [B]BasicHandphone::smsStatus[/B], which you commented out.. so by uncommenting it, you remove that error. You also fergot to add the prototype for the [B]operator>>[/B] function, so change you class like this.[CODE]class BasicHandphone { private: int f; [COLOR="Green"]int smsStatus[/COLOR][10][COLOR="Red"];[/COLOR] int inboxCount; string sms[10]; … | |
Re: This worked great for me.. [URL="http://69.10.233.10/KB/architecture/lint.aspx"]http://69.10.233.10/KB/architecture/lint.aspx[/URL] Otherwise, your going to have to be abit more specific on what you want here. | |
Re: Can you post some code where you are using the [B]_tcscat_s[/B] function? | |
Re: Code this small can easily be embedded into your post, so in future, do it :icon_wink: [CODE=CPLUSPLUS]#define _AFXDLL #include <fstream> #include <string> #include <Cstringt.h> #include <iostream> #include <direct.h> #include <afxv_w32.h> using namespace std; int main() { string line1, line2 ; string end_str ; CFileFind finder; bool finding = finder.FindFile (); … | |
Re: [QUOTE]you are right ....i'm still in the process to understand c++.....i want to make a game that involve throwing or launching of an object but it must have at least one obstacle partially obstructing the throwing path (for example: a high wall) and at least one other difficulty for the … | |
Re: You have given no details at all, you didn't even ask a question or describe a problem :icon_confused: , exactly what do you need help with? | |
Re: My recommendation for you.. [URL="http://www.google.co.uk/search?hl=en&q=C%2B%2B+tutorial&btnG=Search&meta="]http://www.google.co.uk/search?hl=en&q=C%2B%2B+tutorial&btnG=Search&meta=[/URL] | |
Re: I made a game in Win32 but it was quite difficult. It is called the 'SameGame' or commonly known as bubblebreaker mainly for phones, It might just give you an idea of how difficult it is to make these kind of games using Win32. | |
| |
Re: >make a simple program If its so simple, why can't you do it?, or at least make an attempt at it. All you need to know to be able to do this, is how to use [URL="http://mathbits.com/mathbits/compsci/looping/nested.htm"]nested loops[/URL] and from there i'm sure you could figure it out yourself. | |
Re: Your going to have to be much more specific on your problem ;) Post more details or code if possible. | |
Re: [QUOTE]for (c = 0; c <= 5; c++) that counts from 0 to 6, not 0 to 5.[/QUOTE] Depends, if you write it like this, it displays [B]"012345"[/B], but [B]c[/B] has the value [B]6[/B] once its out the loop.[CODE=CPLUSPLUS]#include <iostream> using namespace std; int main() { int c; for (c … | |
Re: I've had enough of people like you trying to cheat on or hack runescape, its totally pathetic. And you do know its illegal what your doing right? Look at 4th rule. [URL="http://www.runescape.com/kbase/viewarticle.ws?article_id=2077#what"]link[/URL] And I dont care if your 13, its no excuse to do this sort of thing, Its time … | |
Re: Heres a nice tutorial to start. [URL="http://www.cprogramming.com/tutorial/lesson1.html"]http://www.cprogramming.com/tutorial/lesson1.html[/URL] | |
Re: Well, a simple way to achieve this would be to create another array, the same length as [B]arr[/B], go through each character, and if that character isn't a space then copy it to the second array. Like this.[CODE=CPLUSPLUS]#include <iostream> int main() { char arr[] = "abc def"; // Create another … | |
Re: Why didn't you just post the code?.. [CODE=CPLUSPLUS]#include<stdio.h> #include<conio.h> #include<math.h> float compute_amount(int kilowatt); float compute_tax(float total); void main() {clrscr(); int kilowatt; float Amount; char decide; do{ printf("Please enter your kilowatt: "); scanf("%d",&kilowatt); Amount=compute_amount(kilowatt); printf("Your current Bill for this month is: %f\n\n",Amount); printf("Do you want to repeat your transaction[Y or N]: … | |
Re: Well.. whats your problem? And, learn how to use [URL="http://www.daniweb.com/forums/announcement8-3.html"]code-tags[/URL]. | |
Re: Heres a nice place to start... [URL="http://www.cplusplus.com/doc/tutorial/"]http://www.cplusplus.com/doc/tutorial/[/URL] | |
Re: You test may not be entirely accurate, for example in this part of the code:[CODE]for (int i = 0; i < 2000000; i++) { [COLOR="Red"]stringstream v1(Num);[/COLOR] v1 >> Number1; }[/CODE] Because here you are constructing [B]stringstream[/B] 2000000 times, and destroying it 2000000 times, which obviously is going to add to … | |
Re: I'm not going to encourage cheating, and im certainly not going to give away code, this isn't the sort of thing that can be done in one night, you need to know some advanced C++ stuff, which im guessing you don't know. The only way this is going to get … | |
Re: [URL="http://www.catb.org/~esr/faqs/smart-questions.html#bespecific"]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/URL] [URL="http://www.daniweb.com/forums/announcement8-3.html"]http://www.daniweb.com/forums/announcement8-3.html[/URL] | |
Re: >Can you complete my code? No, why should I? We will help, but we won't do it for you, so unless you have a specific problem, im not doing a thing. | |
Re: GIYF! [URL="http://www.google.co.uk/search?hl=en&q=C%2B%2B+cout+stream&btnG=Search&meta="]http://www.google.co.uk/search?hl=en&q=C%2B%2B+cout+stream&btnG=Search&meta=[/URL] | |
Re: You do realise that this is a 6 year old thread, and [B]ALPha[/B] hasn't had any acivity on this forum for about 2 years ?.. ;) |
The End.