5,237 Posted Topics
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: Show your effort now, then we can help you with the next step. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: What sort of expertese do you already have when it comes to writing windows programs in C++ ? | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: > printf(" sum sequare from %d to sequare%d is %d",m,n,sum); Maybe put this line outside the for loop? Does it print the right answer on the last iteration of the loop? | |
Re: By providing a member function for your stack abstraction class which returns 'isFull'. Stacks normally have no upper bound to the amount they can store, so perhaps the first thing you get to notice is an exception. | |
Re: I've just explained how to do threads with classes here [url]http://forums.devshed.com/c-programming-42/multithreaded-server-class-393019.html[/url] To be honest, tackling threads before you've got the rest of C++ well sorted out in your head is a receipe for disaster. | |
Re: Does your coke machine do anything more than - take money - give can of coke - give change ? Take your assignment and put it in your favourite word processor, and reformat it so there is plenty of white space after each sentence with words like "shall", "must", "should" … | |
Re: Something like [code] ( opc >> 11 ) & 0x3f; // 6 bits opc & 0x3ff; // 10 bits [/code] | |
Re: Split from [URL]http://www.daniweb.com/techtalkforums/thread15252.html[/URL] Don't bump old threads. Please use the tags in future. Also, we need a better description than "it doesn't work". | |
Re: Well this being C++, I would go with something like [code] class csvRow { public: parseLine(std::string); std::string operator[](int) const; private: std::vector< std::string > row; }; [/code] Where parseLine takes a line and splits out all the comma separated values, and stores them in the internal vector. The overload of the … ![]() | |
Re: Ignoring the file issue for the moment, how does the program get a single 'm' and 'a' value? On the command line, like [inlinecode]./testprog 10 20[/inlinecode] Or as a prompt from within the program [inlinecode]Enter m and a values 10 20 [/inlinecode] | |
Re: I'm wondering how many boards I'm going to see this spam on.... In fact, it appears in so many places (thanks google) that I regard it as marketing spam to make people click on the link rather than any serious attempt to ask a meaningful question. | |
Re: Moving it to the "job offers" forum gets my vote. It's also being broadcast all over the net [url]http://forums.devshed.com/c-programming-42/remainder-program-in-c-390830.html[/url] | |
Re: > How do I test the round robin? By having them last a lot longer than one schedule interval. There's not much point if they do one thing and then quit, you're not going to see much of anything. Waiting for each one to exit in turn doesn't help either. … | |
Re: > i want to write a program which could convert given temperature and its unit into oher scales Start with centigrade to centigrade. Very trivial conversion, but it at least gets you to attempt the first part of actually attempting the "prompt the user and get answers" part of the … | |
Re: > [INLINECODE]if (operation != 'A' || 'a' || 'S' ||[/INLINECODE] There is no compare with a list type function, you need to compare with each one in turn [INLINECODE] if (operation != 'A' || operation != 'a' || operation != 'S' ||[/INLINECODE] Look up the toupper() function [INLINECODE]operation = toupper(operation);[/INLINECODE] … | |
Re: Why did you make it static? It makes ALL the accounts have the same annual interest rate, and that's simply not true in the real world. You need this just before your main [code] float SavingsAccount::annualInterestRate = 0; [/code] > using namespace std; Putting this in a header file is … | |
Re: > and wondered if anybody here and also done this? Assume the answer is "no", what is your next question going to be? Then assume the answer is "yes", what is your next question going to be? Or are you just conducting some kind of survey to see which boards … | |
Re: Basically a duplicate thread of this [url]http://www.daniweb.com/techtalkforums/thread55862.html[/url] Closed. | |
Re: See also [URL]http://www.daniweb.com/techtalkforums/thread56253.html[/URL] > [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std; Now I don't know whether this is an endemic problem with your coding, but it should be [/COLOR][inlinecode]using namespace std;[/inlinecode], that is, there is a space in there. Now maybe it's you or maybe it's some damn fool code colouring script you're running which … | |
Re: Error messages come with line numbers. Use those line numbers to find out where in the code the problem is. Any editor should have a "goto line" feature, or at least display line numbers in some manner. Post code (annotated with line numbers if necessary) along with exact error messages … | |
Re: > My question is if it is allowed to declare [I]char[/I] fields inside a structure Yes, you can have chars in struct, you can even have char arrays in structs or pointers to chars. You can even have a char bitfield, but only with fewer bits as already noted. > … | |
Re: Use the win32 API as referenced in the examples of the cprogramming.com FAQ. Even if you manage to load ansi.sys, it will only work for true DOS 16-bit applications (which implies some crusty old compiler like turboC). Anything compiled in win32 will simply ignore it. You could always use ncurses … | |
Re: > Since this exercise is on STL queue handling, the ranking of candidates found in a ballot should be organized as a queue The assignment tells you what to use. So a queue containing pairs of "who" and "how many" would seem to be the thing. | |
Re: > here no matter I use "&" or not it results the same. Well one or the other is going to produce at least a compiler warning. Choose the one which compiles cleanly. > why is that? Sometimes, despite the programmers' best efforts to make a mess of it, it … | |
Re: Split from [url]http://www.daniweb.com/techtalkforums/thread26586.html[/url] | |
Re: > I want function called [B]void ten (void);[/B] to go into c particular memory range. You can, but why would you want to? Both your operating systems are perfectly capable of running the code at the default address the linker gives to the function. If you move it too far, … | |
Re: In order of preference strtol() - does conversion and will report numeric overflow / underflow and tell you how much data was processed sscanf() - like strtol() without the over/under flow atoi() - pretty useless atoi("0") and atoi("hello") may both return 0 | |
Re: Does your borland compiler also work if you include iostream (only) to get cin and cout ? | |
Re: > I am being returned incorrect values for circum and area variables. You got the calculations the wrong way round area is pi*r*r circumference is pi*2*r > return x,y; This does NOT return two values, it returns y Also, you're using a class containing data, there is no need to … | |
Re: Use the debugger and put counting breakpoints on malloc() and free(). For a given file, you're saying that they should be equal. BTW, if you're thinking that free(tree) frees the whole tree, then you would be wrong. From the symptoms you describe, I don't think you're freeing the whole tree … | |
Re: > Is it possible to somehow reprogram a Coke/Water/Pepsi w/e machine to dispense drinks Doing it would be theft. Telling you would be an accessory to theft. Not surprisingly, both are illegal. Now, if you have a proper programming question to ask, do so in another thread. | |
Re: Answers here -> [url]http://www.daniweb.com/techtalkforums/thread55402.html[/url] | |
Re: > as i have been asked to implement a simple text editor So a nice simple console editor, with a menu containing a few options a) insert a line b) change / edit a line c) delete a line d) print some lines e) load f) save | |
Re: [inlinecode]for ( i = 0 ; i < 1<<N ; i++ )[/inlinecode] Just print out the binary representation of i to N bits of precision. Easy money. | |
Re: Read this first - [URL]http://www.daniweb.com/techtalkforums/announcement8-2.html[/URL] > student from engg college So start studying then. Your qualification will be meaningless if all you do is google all your answers or try and get other people to do the work for you. When you do get around to posting your own work, … | |
Re: Split from this long-dead thread [url]http://www.daniweb.com/techtalkforums/thread31283.html[/url] | |
Re: > If no, then why calloc() is returning NULL to the array Well your use of 'far' strongly suggests the fact that you're using an ancient 16-bit compiler rather than a more modern 32-bit compiler. The maximum single allocation you can have is 64K (your array is 128K). @ andor … | |
Re: > void fun(int **array) The rule about arrays become pointers is not recursive - it only happens for the outermost level of the array. [INLINECODE]void fun ( int (*array)[40] );[/INLINECODE] is one way to declare the function. This is another way, which is easier to remember since it's just copy/paste … | |
Re: You've basically written this [code] struct node { int a; struct node { int a; struct node { int a; struct node { int a; struct node { int a; struct node x; // and so on.... struct node *pnext; }x; struct node *pnext; }x; struct node *pnext; }x; struct … | |
Re: As in [code] char n1[] = "358"; char n2[] = "235"; int carry = 0; sum = carry + (n1[2] - '0') + (n2[2] - '0' ); // Add "8" and "5", as 8 and 5 result = sum % 10; // ie 3 carry = result / 10; // … | |
Re: Providing the author did the job properly, all you need to do is recompile it on the target machine. | |
Re: So how much have you managed yourself? - reading a line in - separating the number and the word - storing them in an array ? Post what you can achieve, then the answer will be more likely tuned to your specific needs. It also shows you've done some work … | |
Re: [url]http://en.wikipedia.org/wiki/Big_O_notation[/url] > why we ignore constant for example f=100n Because it's meaningless when you're considering the "asymtotic" behaviour. Like 100*infinity is no different to 50*infinity or just infinity. Such minor order terms only come into play for small n, and vary widely depending on such things as - the processor … | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] You say you've tried something, so post your best effort so far. Don't forget this when you do post code. [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] | |
Re: > for (int i = 0; i <= 12; i++) > for (int j = 0; j <= 11; j++) > for (int k = 0; k < 11; k++) Only one of those loops correctly accesses all the elements of your array. One of them steps off the end, … | |
Re: If they're all in the same directory, then [inlinecode]#include "listdbl.h"[/inlinecode] Then it should find that header file just fine. If you have [inlinecode]#include <listdbl.h>[/inlinecode] Then you need to specify a search path. From the command line, you might try CL /I. prog.c | |
Re: Post your best attempt at the problem so far. Being able to just copy stdin to stdout without any of the substitutions would be a start at least. |
The End.