2,839 Posted Topics
Re: [quote] if (ch = 32) { [/quote] You should change this to : [icode]if (ch == 32)[/icode] The single '=' means that you are checking if ch can be assigned the value '32'. What you want to do is : check if 'ch' contains the value '32'. (double ==) and … | |
Re: The program looks better now. If you want some minor performance tweaks: change [icode]for(count=1;count<=x;count++)[/icode] to [icode]for(int count=1;count<=x;count++)[/icode] and remove the previous declaration of count. This has a few advantages: - the memory declared for count, is cleared after the loop is done - your program will look better, less declaration … | |
Re: [URL="http://www.cplusplus.com/reference/iostream/istream/getline.html"]getline[/URL]() would be the function for you. Just use a space ' ' as a delimiter. | |
Re: You're probably messing with memory that isn't yours, or accessing a file that is accessed at the same time by something else, or writing to a socket that was closed or never opened, or .... Without seeing your code, it just a guessing game | |
Re: Why not just close the second form? [edit] I've actually read your code and the errors in it have nothing to do with the question you asked here. - in form2.h add the line [icode]#include "form3.h"[/icode] - in interface.cpp change [icode]#inclide "form2.h"[/icode] to [icode]#include "form2.h"[/icode] Code works fine after these … | |
Re: OpenCV's HAAR-detection is what you need. Be aware that the learning-time will be enormous, specially for objects that 'look alike' like an arm or a leg... There's a face-detection demo-program in the tuts from OpenCV, you might want to take a look at that. Niek | |
Re: in main.c: [icode]#include misc.h[/icode] in misc.c: [icode]#include misc.h[/icode] Put your main() in main.c and your function prototypes in misc.h | |
Re: You could use findfirst() and findnext() to get the names of all the files in a derectory, then just use a loop to open and process them. [edit] [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046380353&id=1044780608"]Here's[/URL] some samplecode | |
Re: strtol takes an extra parameter that can be set to what array-element it should convert. So you could only convert the first 3 chars to a long, or 10 or the middle 5 or ... etc. atol does not have this functionality. [edit] And what Narue says is also true, … | |
Re: If you post your code, we could have a look if it's easy to port it to Windows. | |
Re: You could make an array of strings and then randomly select one from this array using rand(). If you search for rand() on the site, you should get a lot of example programs. Niek | |
Re: [QUOTE=Sohiab;580592][B]I'll help you. Check PM![/B][/QUOTE] Please read [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]this[/URL] the part about 'keep it on the site' | |
Re: you should create a loop which takes in a number with every pass, adds it to a total number and stores how many numbers where entered (how many passes the loop made) Then you would need something to break out of the loop. When you're out of the loop, calculate … | |
Re: What Vmanes said and: This line: [icode] acc_num[x] = rand()%10; //generate account number[/icode] Will always generate the same sequence of numbers because you haven't seeded the function rand() with [icode]srand()[/icode] Most people use [icode]srand((unsigned)time(0));[/icode] for this. [code=c] return 0; system("pause"); [/code] The line [icode]system("pause");[/icode] will never be reached because you … | |
Re: [QUOTE=Taker;580035]do you want the txt file or not[/QUOTE] That would be a good idea. If the textfile has a lot of similair lines, just post the first few lines. Also: Define 'bugs'. What output are you expecting and what IS the output. When do the bugs occur? | |
Re: If you understand the logic behind the Search-Algorithm, C++ (or even C) could certainly be used to implement it. Without knowing exactly how much you know about programming it is impossible to know how much time it would take you. I used the 'google-search' and found this zip file you … | |
Re: I've had this problem in the past. I used a custom function made by someone else, because I couldn't write my own... [URL="http://www.openasthra.com/c-tidbits/i64toa-converts-a-64-bit-integer-to-string/"]Click[/URL] | |
Re: [quote=Lerner] If that doesn't work, and it may well not, then I'd try reposting, enclosing all your code, including the last 4 closing curly braces and hope that will maintain indenting to make the code more readable [/quote] So please repost you complete code | |
Re: You could use a timer-control. Here's a good [URL="http://www.vbdotnetheaven.com/Uploadfile/mahesh/TimerControl04262005033148AM/TimerControl.aspx"]tutorial [/URL] | |
Re: You can't nest functions like this: [code=cplusplus] int main() { [...] void sortit(int exams.at(i).total.at(j), int exams.size()) { [...] } }[/code] | |
Re: Tutorial on cubes: [URL="http://cgm.cs.mcgill.ca/~msuder/courses/557/tutorial/tutorial.html"]link[/URL] tutorial on textures: [URL="http://www.nullterminator.net/gltexture.html"]link[/URL] | |
Re: I'm not sure what output you are expecting. Could you post an example of what your program is supposed to do? | |
Re: [QUOTE=coolerli;578974]solve it already[/QUOTE] What?! I really hope that is a typo and you meant: "solveD it already".... | |
Re: [QUOTE=Ancient Dragon;578931]I don't take kindly to people who laugh so much :)[/QUOTE] I thought Narue was kidding here: [QUOTE=Narue;568027] Ancient Dragon [...] The rest of the time he's your typical cranky old man. [/QUOTE] But you've just proven her point ;) Just kidding ofcourse | |
Re: [code]sentence[0] = toupper(sentence[0]);[/code] sentence[0] is a char array, but toupper() only excepts 1 char as input. This is a C program, but you've posted in the C++ forum. Are you allowed to use C++? Because std::string would make your live a whole lot easier. Niek | |
Re: Go to here: [URL="http://www.daniweb.com/forums/"]http://www.daniweb.com/forums/[/URL] and click on a yellow folder-icon to mark the forum as read. Niek | |
Re: What I would really like is that the controlpanel would auto-refresh every x minutes. I usually have my laptop viewing my controlpanel on daniweb while I'm programming on my PC. Sometimes you are helping someone that is on-line so he will respond very fast to my reply. I know it … | |
Re: [quote][icode]char word, word1, word2,word3, length;[/icode][/quote] You've declared everything as chars, not strings. A char is ONLY ONE character, not a word. So declare them as strings like this: [icode] std::string word1, word2,word3;[/icode] Length doesn't have to be declared and you still have one if statement wrong. Please re-read AD's post … | |
Re: [QUOTE=Sky Diploma;576739]Hey Try compiling it with any other compiler or try this [code] #include<conio.h> [..] void main() [...] clrscr(); [...] getch(); [/code][/QUOTE] That won't work on any other compiler because it isn't standard C. It will probably only work on Turbo C, which is outdated. At brianvolkmann : You have … | |
Re: One way of getting the current folder is: [code=cplusplus] #include <direct.h> #include <iostream> int main() { char buffer[100]; getcwd(buffer, 100); std::cout << buffer << std::endl; return 0; }[/code] Niek [edit] After trying the code I noticed that getcwd was declared deprecated, so you should use [URL="http://msdn2.microsoft.com/en-us/library/sf98bd4y(VS.80).aspx"]_getcwd [/URL]instead [/edit] | |
Re: Very simple mistake: [icode]if (str[x] == "a")[/icode] should be: [icode]if (str[x] == 'a')[/icode] You are comparing each character from a string with another character, so you need single quotes instead of double [quote] if I have done something against the forum rules [/quote] Actually, you are one of the few … | |
Re: Did you #include <windows.h> in your project? | |
Re: No it's not, but it's a helping hand. In the code given each line is stored (in a loop) in the string "answers". So what you need to do is combine the two programs so that your own function will parse these strings | |
Re: I googled for 1 min : [URL="http://www.alglib.net/optimization/brent.php"]click[/URL] | |
Re: Time for some ASCII art [code] (x1,y1) |----------------------| | | | | | | |----------------------| (x2,y2) [/code] You see how 2 points can make a rect? Learn more about OpenGl and C++ by visiting some links [URL="http://www.daniweb.com/forums/thread63827.html"]here[/URL] | |
| |
Re: Does the file exist on you harddrive? If not: Do you have the iptables-devel & libnet packages installed? | |
Re: If you mean changing the language for Windows/IE , reinstalling would be the only option that I know of. Niek | |
Re: How do you plan to get radiosignal in your PC? | |
Re: I think (s)he means something like : [icode]string Number = "001";[/icode] at OP: Why not convert every line to integer and then sort them as integers. You wouldn't need char-arrays and your sorting should be easier to code. Niek | |
Re: [QUOTE=wsn;575712] this code is not even compiling Can anyone please help me =)? Thanks[/QUOTE] You have a bracket mismatch in this line: [icode]#define NBIT(X,N) (((X&(1<<N))?1:0)[/icode] there is 1 opening bracket to many. so changing it to : [icode]#define NBIT(X,N) ((X&(1<<N))?1:0)[/icode] should solve the problem. then remove all the unsigned crap. … | |
Re: Here's a [URL="http://www.hitmill.com/programming/cpp/forLoop.htm"]tutorial[/URL] on 'for loops' | |
Re: Before I say anything else: I fully agree with Ancient Dragon. This is NOT an assignment for a beginner in C++. But if you decide to go ahead and give it a try: I would suggest using [URL="http://opencvlibrary.sourceforge.net/"]OpenCV[/URL] for image-processing What country are you from? Do your coins have different … | |
Re: [QUOTE=Galaxiaunit;570221]By the Way how did You made these Numbers in Code I would like to know that ?[/QUOTE] To get the line numbers and code-coloring use [noparse][code=cplusplus] your code here[/code][/noparse] tags The first error the compiler gives you is about this line [icode]rodzaj[10];[/icode] (line 9) You didn't give it a … | |
Re: [quote=jwenting]"get Outa Here, Now!"[/quote] :) [QUOTE=technogeek_42;521411] Y they create a virus?[/QUOTE] All sorts of reasons. Maybe they want to have your adressbook, maybe your creditcard numbers or maybe they're just doing it for the kick. Asking why people make virussses is the same thing as asking why hooligans exist Niek | |
Re: You should use a loop from that loop from the first item in the list to the n-th. | |
Re: That's funny... If I compile a big program or run a game my fan also kicks in. Maybe my laptop is just absolutely STUPID? Niek | |
Re: @Narue: If you want to promote your own website, go to the [URL="http://www.daniweb.com/forums/forum43.html"]promotions[/URL] forum. ;) | |
Re: I got 22 Warning: spoiler: saw children of the korn the crow butterfly effect seven the ring texas chainsaw massacre scream the fly invisible man birds jaws alien nightmare on elm street halloween a clockwork orange beetlejuice war of the worlds pumpkinhead blade piranha [one more that I forgot to … | |
Re: How to code: I always use a keyboard Now try to ask a clear question with your problem and any attempts you've made and post again. Niek |
The End.