5,237 Posted Topics
Re: Placing things in memory is down to the linker, not the compiler. Which tool chain (compiler, linker etc) are you using? | |
Re: My clairvoyant skills tell me the problem is on line 12 of your code. But since few other people possess such skills, I guess you'll just have to post what you tried so far. Make sure you read the "how to post code" sticky thread at the top of the … | |
Re: > You cannot use C to solve this problem. Of course you can, it just takes an additional library to help you do all the hard stuff. [url]http://gmplib.org/[/url] Or if you're only interested in a couple of math ops, then you could work out how to do long arithmetic in … | |
Re: Put the %1 in quotes, like "C:\Program Files\Text Compress\TextCompress.exe" "%1" | |
Re: Two things spring to mind. 1. Your script kiddie speak is hard for me to read, and I'm a native English speaker. One wonders what others think of it who are not native speakers. [url]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url] 2. Your code is so badly indented that neither you nor anyone else can figure … | |
Re: > push((unsigned char)(ps[idx].v.val & 0xff); Well this line is missing a ) | |
Re: > its not for me but for my boss's doughter. Ohhh - smoochies by proxy. Nope, sorry, doesn't cut it. Got anything else in #include <std_excuses.h> [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] | |
Re: I'm sure it was worth waiting 2 YEARS for you to show up with an answer :rolleyes: In the meantime, feel free to swing by the "[URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]how to use code tags[/URL]" readme thread at the top of the forum on how to post code which isn't an unindented mess. | |
Re: Well a lot depends on your OS and compiler. Are you allowed to use libraries like ncurses? | |
Re: [code] int arr[10]; int *pArr = malloc ( 10 * sizeof *pArr ); myFunc( arr ); myFunc( pArr ); [/code] The function itself doesn't care whether you have a real array or a pointer to allocated memory, the function is declared and written in exactly the same way. | |
Re: I'd suggest you start with the simple obvious thing of using strtok (in C), or using getline() with a delimiter (C++). File I/O is going to have a lot more impact on how long this is going to take than what you might do in finding and splitting a string … | |
Re: You could make it really transparent by not drawing it at all :p | |
Re: Maybe because kbhit() doesn't read keys, it only tells you whether there is a key available. To actually read it, use getch() or something like it (since you seem to be in DOS land). | |
Re: Apparently [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] Isn't in a big enough font, all the noobs keep missing the point. | |
Re: > #define SIZE 10; Step 1 is remove the ; Step 2 is to stop using the pre-processor to declare constants in C++ programs, and declare [INLINECODE]const int SIZE = 10;[/INLINECODE] | |
Re: Reading isn't your strong point is it? You missed this - [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] describing code tags. You ignore the watermark at the back of every edit window telling you about code tags. I asked you here [url]http://www.daniweb.com/techtalkforums/thread73983.html[/url] to use code tags as well. What's it going to take? | |
Re: void readList(int nums [], int size); void printList( int list[1000]); Notice what's different ? The 1000 isn't actually doing anything useful (nor is it actually harmful either). It certainly has nothing to do with the size of the array being passed. Also, read the intro threads and how to use … | |
Re: > for(int j=count;j<prod;j++); It didn't fix a damn thing, you just moved the problem. The scope of 'j' ends at that ; at the end of the line - this is a loop which does NOTHING then exists. Had you removed this ; then the problem would have fixed itself … | |
Re: Make an effort, this isn't [url]www.spoon-fed-programmers.com[/url] [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] Then learn some netiquette [url]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url] The SHOUTING, the colours (it burns it burns), the stupid "leet speek" wannabe writing style, and the overuse of smilies. | |
Re: > Just out of curiosity, does anybody know how it works? Read the documentation and download the code. | |
Re: > PostQuitMessage; Maybe if this were a function call, say PostQuitMessage(0); Perhaps posting actual error messages instead of "it doesn't work" would help as well. | |
Re: Help means you've done something already, and then got stuck on some specific question. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: Argh!! - it burns - untagged void main code - make it stop!!!! Not to mention [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] ![]() | |
Re: Some indentation wouldn't go amiss either. | |
Re: Learn about code tags - [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] Didn't you see the watermark when you were writing your post? | |
Re: scanf("%s", &local); printf("Introduce el nombre del equipo visitante:\n"); scanf("%s", &visitante); Both these variables need to be char arrays, not single chars, if you want to store a string there. | |
Re: Seems simple enough [code] int main() { if (!printf("welcome ")) { printf("welcome"); } else { printf("to ieg"); } return 0; }[/code] | |
Re: [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] I suppose the easiest one to explain is to take the 8:8:8 (8 bits red, 8 bits green, 8 bits blue) and turn it into 3:3:2 format. This is simply a matter of taking the top 3 bits of red and green, and the top 2 bits of blue, … | |
Re: "Congratulations" on the most useless bump of a 2+ year old thread :mad: | |
Re: > You have to specify at least first dimension otherwise its not going to work anyway. > The secong dimension can be left unspecified. Wrong way round - it's only the left-most dimension which can be left empty, all the minor dimensions need to be specified. | |
Re: > it returns diferents results than the original one which works good... Development stops when the program produces the expected answer, not when it is bug free. Porting to another platform is usually when a whole host of previously hidden bugs first make an appearance. In essence, you need to … | |
Re: Well that really depends on whether myFunc was declared with char* because - the programmer was too lazy to say const - because the function does actually modify the string. The first is fixed by fixing the code. The second is fixed by making a modifiable copy of the string … | |
Re: That data sheet talks about parallel or serial versions, you need to figure out which one you've got. Read the appropriate one of these, for the type of operating system you're running on your development PC. [url]http://www.lvr.com/parport.htm[/url] [url]http://www.lvr.com/serport.htm[/url] I'm assuming this device is plugged into your PC in some fashion. … | |
Re: > cout << [B][COLOR="Red"]'[/COLOR][/B]Your new monthly salary is: " << nMthSal << endl; Well this line should use double quote at the beginning, not single. | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] | |
Re: Wow - that's the most impressive bit of board abuse that I've seen in a long while. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] Is all that lot in the 1/2MB doc attached to your other post? [url]http://www.daniweb.com/techtalkforums/thread73333.html[/url] | |
Re: It's just another character which is valid to use in identifiers Like [INLINECODE]int number_of_apples;[/INLINECODE] Another popular choice is camel case, which would be [INLINECODE]int numberOfApples;[/INLINECODE] Both are generally better than say [INLINECODE]int numberofapples;[/INLINECODE] | |
Re: Please use [c[b][/b]ode][/code] tags around your code. Nobody wants to read a whole mess of unindented code. | |
Re: > int array[]={4,3,5,7} Think about recursion in terms of 4 + all combinations of 3,5,7 3 + all combinations of 4,5,7 .. .. Which becomes in the recursive step 4 + 3 + all combinations of 5,7 4 + 5 + all combinations of 3,7 When you're down to all … | |
Re: Probably because the memset on line 721 is trashing memory. Whenever you have a <= and an array, it's a pretty sure bet you really meant <, and that you've just stepped off the end of the array. Plus, it's all so unnecessary as well. What you should have had … | |
Re: main returns an int (see the avatar) You could do [code] for ( i = 0 ; i < 30 ; i++ ) { sprintf( a, "file%02d.txt", i ); fstream file; file.open(a,ios::in |ios::out); file<<"anshulgarg"; file.close(); } [/code] Which will generate file00.txt to file29.txt This reacts much better to you changing … | |
Re: > but I'm wondering which function will do the trick-read a char from keyboard without need to press "Enter" Yes there is, but not without you saying which OS / Compiler / application type (console, GUI etc) you're trying to write. There isn't a standard "one way works for everyone" … | |
Re: > p->next=p->next=->next; It doesn't do anything, because it won't compile. Also, since you keep changing p, your condition will never fail (loop forever, chasing your tail like some demented dog). | |
Re: Read everything as a string, then convert it to an input string stream where you can work your way through it at your own pace. Example [code] #include <iostream> #include <sstream> #include <string> using namespace std; int main ( ) { cout << "Enter command " << flush; string s1; … | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] This should be in a bigger font, people keep missing it and just dumping their homework on the board. Since this isn't likely to be your first assignment, then it means you must have done some of the preparatory work before, like reading files or extracting data. | |
Re: Tell us your OS and compiler, and the kind of program you're trying to create (console or GUI), and perhaps you'll get a more meaningful answer. | |
Re: Your question is meaningless. One is an application framework, and the other is a compiler. [url]http://www.trolltech.com/developer/notes/compilers[/url] You use VC++ to compile your QT application on a windows platform You use GCC to compile your QT application on a Linux platform. | |
Re: [url]http://en.wikipedia.org/wiki/Floating_point[/url] Never compare floats using == or != Your answer may be very close to zero, but if it's even the tiniest bit off, then your code will fail. Floating point numbers are approximations, which means you need to make approximate comparisons, or range comparisons. So rather than == 0, … |
The End.