2,839 Posted Topics
Re: What compiler/OS are you using? This sort of thing smells like a job for MFC to me | |
Re: [QUOTE=ZZucker;604825] I always thought that the stars where the LOL count.[/QUOTE] Tss.. I have 1 star and I dare you to find one other post then this one, where I use the word 'LOL' ;) | |
Re: You should stop talking like a kid. 'No' and 'know' are two different words. You could also use some CAPS. Read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL] (the part called 'keep it clean') But on topic: how do you know that the answer is 'c' if you don't know why? If the teacher gave … | |
![]() | Re: Actually, main DOES return a value. Never mind what you teacher told you or what Turbo thinks is normal, main returns an int. So use [icode]int main(void)[/icode] and [icode]return 0;[/icode] If you are switching compilers, you might want to look at the findfirst() and findnext() functions ![]() |
Re: Did you read the big fat [URL="http://www.daniweb.com/forums/thread70096.html"]README[/URL]: just above you own post? [edit] Ahh, I see you did. Good job! We posted simultainiously ;) | |
Re: [QUOTE=Sky Diploma;604622] Correct me if i am wrong.[/QUOTE] Ok: [URL="http://www.daniweb.com/forums/post602806-11.html"]click[/URL] But you're right. Vectors would be the best solution. @Daniel: What does this code do? Does it compile? Does it give runtime errors? Please be more specific. Also when posting code, please use [icode] [noparse][code=ccp] your code here [/code][/noparse] [/icode] … | |
Re: [QUOTE=tharris7;604634] [ICODE]char dictword[32]; }[/ICODE] [/QUOTE] Why use char arrays when c++ provides you with strings? Mixing up C and C++ is very confusing and will require a lot of casting. So what about something like: [code=cpp] string word = "abc"; string dictword; ifstream dictionary("dictionary.txt"); while (getline(dictionary, dictword, ' ')) { … | |
Re: to pause your program, simply use [code] std::cin.ignore(); std::cin.get(); [/code] for other (better) options click [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385"]here[/URL] | |
Re: [QUOTE=Sky Diploma;604274]Yes, Consider this example [code] [....code] cin >> numbers [5];/* Error:: No Space allocated (This is becoz it is the 6th number) And the compiler set a space for 5 numbers and the 6th number has no space .. */ for (int n=0; n<=6;n++) { cout<< number[n]<<"\n"; } return … | |
Re: [code=cpp] ifstream File("C:\\File1\\"); std::string Line; while( getline(File, Line, ',') ) { // do stuff } // the end of the file is here [/code] It's as simple as that ;) And I wouldn't use 'File' as a name because it looks to much like : FILE. Something like 'infile' would … | |
Re: @ jephthah : If you are using Visual studio 200(x) you can let VS do all the hard work of indenting by pressing: [code]ctrl-a ctrl-k ctrl-f[/code] You can even change a setting so that the indention becomes 1 tab, or 4 spaces or 2 spaces or... | |
Re: [QUOTE=xlx16;604246] don`t use using namespace std; and stuff like that because i think my compiler dosent work with new standards[/QUOTE] In that case you might want to post you question in the [URL="http://www.daniweb.com/forums/forum118.html"]C forum[/URL] But be sure to read [URL="http://www.daniweb.com/forums/post604203-2.html"]Salem's post[/URL] and ask a clear question. Use proper English and … | |
Re: very simple: you are using ' i ' in two nested loops and every time you enter a loop i becomes 0 (lines 14 and 25) | |
Re: Here's another members of the stars-club (1000+). It took me 1.5 years, so in 15 years I'll have 11000 posts too ;) | |
Re: The function is expecting an [URL="http://www.cplusplus.com/doc/tutorial/arrays.html"]array [/URL]of strings as it's second parameter | |
Re: [QUOTE=n1337;602784] move through the file character by character. [/QUOTE] It would work, but it a bit too 'C' for my taste. How about using the getline() function with a third parameter as delimiter? [code=cpp] ifstream file("yourfile.txt"); if (file) { std::string word; std::vector <std::string> array; while ( getline(file, word, '<')) array.push_back(word); … | |
Re: It still depends on what OS you're using, so the answer would be: no, c++ does not have anything standard for that | |
Re: You're asking two different things: If you want to replace a element in a vector, ,you should pop until you've reached the element you want to change (storing all the popped values somewhere in a temp-var), then push the new value in and then push all the old values back … | |
Re: hmmm... I wonder if someone with certain Database-access could find out about who we're talking... But not to worry: the posts above my own are true as far as I know. Or maybe I just haven't found the right links yet ;) | |
Re: [QUOTE=nelledawg;600544]I thought fp = fopen(“data.dat”, “ab”); was the right way to code it. [/quote] no. it's [icode]fp = fopen("data.dat", "ab");[/icode] (wrong quotes) [QUOTE=nelledawg;600544] What do you mean when I have something useful make a copy of it? [/QUOTE] He means ALWAYS backup, backup your backups and back them up ;) … | |
Re: [QUOTE=hacker9801;601388]... num1 is already of [b]int[/b] type, you WOULDN'T be able to enter a character anyway.[/QUOTE] Why not? Just press something on the keyboard. It would be a good idea to check wether the input is int or not. Perhaps something like: [code=cpp] using namespace std; int main() { while(1) … | |
Re: I think it goes like : [code=cpp] #include <windows.h> int main() { HWND hWnd = FindWindow(NULL, "The title of the window to hide here");; if(hWnd) ShowWindow(hWnd, SW_HIDE); Sleep(5000); } [/code] [edit] I missed the part where you said "by executable name", so my code is probably not what you want, … | |
Re: How about searching monsterboard or any other job site and see how much is about average. We don't even know from which country you are, and the salaries vary a lot between countries. Especially with the weak dollar nowadays | |
Re: Are you sure you stopped debugging correctly? Not paused or something? What debugger are you using? Perhaps you can show some code | |
Re: put this: [code=c++] std::cin.ignore(); std::cin.get(); [/code] between lines 18 & 19. your program will now wait for a " \n" (enter) to be pressed before exiting. for a more detailed solution (and better) look [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385"]here[/URL] | |
Re: You should look at functions as a vendingmachine. You put some input in it (in your case two ints) and it gives you something back. That's what the [icode]return[/icode] does in your function. So you need something to put the returned value in. That what the 'difference' variable does. It … | |
Re: and don't forget to [icode]delete[/icode] the memory once you're done with it | |
Re: nah. You got the assigment wrong. You start with an array of ints. for example: int number[10] = {1,2,3,4,1,6,7,8,9,1}; Now you will have to write a program to see how often the number '1' appears in the array. The easiest way to do this is to make a loop that … | |
Re: You'll have to contact Dani about that. It has been done before (JoeProgrammer and Proliant_Fan aka John A and JBennet :) ) | |
Re: [QUOTE=jbennet;595108]please dont do "loooooooooooooooooooool" or you will get a warning[/QUOTE] "Respect my authoritah!" ;) | |
Re: [URL="http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx"]Tutorial[/URL] | |
Re: How big are the matrices? What values do rowsa and columnsb have? The segmentation fault probably has something to do with you getting out of array-bounds, but without the complete code, I can't tell. | |
Re: You do know that you've declared a 2-d arrays of chars, not an array of strings right? If you use std::string, you could use the swap() function, which might be very handy with selection sort. If you google for sort and strings, you'll get some nice [URL="http://www.codepedia.com/1/CppSelectionSort"]demo-code[/URL]. | |
Re: [QUOTE=Adrian99420;594720]Any idea? I need this in urgent...thanks[/QUOTE] You ALWAYS need it "urgent". Stop bumping your threads, it's annoying, against the rules and won't get you help any sooner. With that said, you need to take a look at [URL="http://msdn2.microsoft.com/en-us/library/ms645481(VS.85).aspx"]GetDlgItem[/URL](). It's a function to get all the items from an dialog … | |
Re: I think DMR was super-mod at the time he changed all the polls to wombats. I guess that was the reason to change this. I personally liked the wombat-mania ;) | |
Re: [QUOTE=peter_budo;590203]@jbennet - this sort of topic students do from all over the world, [/QUOTE] You're right. I've already made an autonomic robot that had color and object detection to participate in a ball-grabbing contest and I still have a year left on the "HTS" (don't know the English equivalent) I'll … | |
Re: [QUOTE=VisActualyBasic;589423] Whats my native language: Lived 20 years in Croatia Lived 17 years in Belgium Live currently (last 13 years) in Australia Mother German [/QUOTE] Wow.. You've been around. 3 countries and 3 marriages, is that related somehow? ;) | |
Re: your loop should look like this: [code=c] // loop while i is between first and second input for (i=firstNumber; i <= secondNumber; i++) { // now using an if statement check if the number is odd or even } [/code] You should have a look at the modulus % operator … | |
Re: Why would you even want to mess around with dos anyway? A 32 bit OS runs on almost anything nowadays. I mean, even your telephone probably runs on something like WinCE or Solaris | |
Re: Aaahhh my eyes... Please don't use color tags in plain text. Also: This is not a homework service. No one will write your homework for you if you show no effort at all. This is explained [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]here[/URL] So what have you made so far? Please use [noparse][code=cplusplus] // code here[/code][/noparse] … | |
Re: whenever I try something new, I use [URL="http://www.google.com"]google[/URL] to search for [URL="http://c-programming.suite101.com/article.cfm/c_tutorial_file_handling_commands"]tutorials...[/URL] | |
Re: Post the code you have so far, it's easier to give advice that way. (and if you want to score some credit, use [noparse][code=cpp] //your code here [/code][/noparse] tags) | |
Re: [QUOTE=Afi83;585203]I know the loop don't enter. if you see i mentioned that i my question. [/QUOTE] Yes, he saw that. He also explained your problem for you, so that you can come up with a solution yourself. This is a great attitude if you want people to ignore your problem, … | |
Re: Goto start->run type: regedit [enter] goto HKEY_LOCAL_MACHINE goto SOFTWARE goto MICROSOFT goto WINDOWS goto CURRENTVERSION goto RUN click on the folder run, which you've just openend You'll see a white icon with a red 'ab' in it an the right side saying: rundll32.exe "C:\WINDOWS\system32\upefwdyk.dll" select it and press delete. Job's … | |
Re: assuming the number is inputted by the user: [code] get user input loop trough each character and look if it's a digit replace the character with * [/code] Have a look at the [URL="http://www.cppreference.com/stdstring/isdigit.html"]isdigit()[/URL] function ![]() | |
Re: You'll have to give a bit more information. What is your program's input? The Fault? How do you get the input, keyboard/file/socket/other What have you tried so far? |
The End.