6,741 Posted Topics
Re: If you use the stable version, you just run the installer and you're ready to go. If you're using a nightly build, there's not an installer and you have to add the necessary components manually. Have you gone through the steps [url=http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks]here[/url]? | |
Re: Sorry, we're not here to do your work for you. If you have a specific question (aside from "Can you do it for me?"), we'll be happy to help. | |
Re: >I urgently need help Nobody cares if it's urgent for you. Stating that your problem is urgent will cause the nice people to do nothing different than they normally would and the sadistic people to actively ignore you. >How do i get rid of the leading zeros. Do a partial … | |
Re: There's no need for string handling functions. You can use scanf to get that behavior: [code=c] #include <stdio.h> int main ( void ) { char word[100]; printf ( "Enter some words: " ); while ( scanf ( "%99s", word ) == 1 ) puts ( word ); return 0; } … | |
Re: Why don't you run it and find out without needing to predict? | |
Re: >am not able to install the service , an exception gets raised What exception? | |
Re: >do you know where i can get help or learn to make it myself? There are tons of papers on OCR, ICR, OMR, and whatever **R's you can think of for document processing. However, I don't know of any off the top of my head that don't require access to … | |
Re: >I was talking to a couple friends today about a really old game for NES. Zelda 2 Hopefully the words you used included "I'm glad I can't play it", "crappy side scroller", and "embarrassment to the series". ;) >Anybody want to help me out with finding one. The last time … | |
Re: >name[0].set(123, aLastName, aFirstName, 617-538-2888, 1000.00); You haven't declared aLastName or aFirstName. >617-538-2888 That's totally not doing what you think it's doing. :D | |
Re: A reentrant function is just a normal function that can be called concurrently. So if you have two threads or processes that call the function at the same time, everything works fine. A non-reentrant function is one that has some hidden internal state, such as global or static variables, calls … | |
Re: Um, just set the PasswordChar property of the password text box to '*'. | |
Re: >why do i need to declare the key word template<class t> >on every function defintion of the member function. If the definition is inline, you don't have to: [code=cplusplus] #include <iostream> template <typename T> class foo { public: void bar() { std::cout<<"foo::bar\n"; } }; int main() { foo<int> f; f.bar(); … | |
Re: >Anyone has an idea on how to go about doing this? Yes, I have two that come to mind right away. 1) Create a new thread that asks for input. You can specify a timeout for the thread and wait for it in the main program. For example: [code=cplusplus] #include … | |
Re: You probably want to use opendir, readdir, and closedir. Ask man for more details. | |
Re: There's more than one way to do it, and there are questions that have to be answered first. What kind of database is it? Do you already have a connection? Are you running a stored procedure or an ad hoc query? Does the query need any input? Are you doing … | |
Re: You have a lot of unnecessary semicolons. Also, in [ICODE]printf{"Hello World!\n"};[/ICODE] you use parentheses, not braces: [code=cplusplus] #include <stdio.h> int main (void) { printf("Hello World!\n"); return 0; } // main [/code] | |
Re: Your code isn't const correct and you need to remember that NOT_IMPORTANT is a function, not an object. This compiles, but it may not be what you were looking for: [code=cplusplus] class packageType{ private: packageType(string name){} ~packageType(){} string name; public: const static packageType* NOT_IMPORTANT(){return new packageType("Not Important");}; const static packageType* … | |
Re: >isn't there any other more efficient way How is that not efficient? You'll find that any solution consists of "go here and write this glyph", which is precisely what you're doing with printing a backspace and then a space. >or direct way to do that...?? Standard C++ doesn't give you … | |
Post your tips for making life easier in C and C++. I'll start: [SIZE=3][B]Standard vector object initialization[/B][/SIZE] The biggest problem with the standard vector class is that one can't use an array initializer. This forces us to do something like this: [code] #include <iostream> #include <vector> using namespace std; int … | |
Re: Do you need the first array or is it just an intermediate for the array of unique words? If it's the latter, you'd be better off using a suitable data structure that doesn't allow duplicates from the get go, like a std::set: [code=cplusplus] #include <algorithm> #include <iostream> #include <iterator> #include … | |
Re: >there is no spaces and all of the structure is gone. That's because you ignored the multiple notifications and instructions the forum automatically gives you on using code tags. I'll add code tags for you this time, but feel free to consider this your warning to use them next time. … | |
Re: >I know one person who uses Linux and the only place that I ever see a Mac is at school. So you have two examples in your everyday life where non-portable code would be a problem. :icon_rolleyes: | |
Re: >Thanks for any constructive critisism!! PrsAnyKey2Cont is a very awkward name. | |
![]() | Re: [code=cplusplus] for (ListNode* p=this; p!=0; ){ p=p->myNext; delete p; } [/code] Yea, that's kind of scary. First, when you delete p, you're calling the destructor... Second, why in the world is your [b]node class[/b] performing a [b]list operation[/b]? Your node shouldn't give a hoot about other nodes, that's something your … ![]() |
Re: >I am thinking a character array, go through each character >one by one in a loop, and comparing it to a list of 0-9. That's an option, but keep in mind that there's a digit after the underscore in your second example. It looks like you want to skip the … ![]() | |
Re: >how do i get it to terminate when my first key input is "Enter" ? cin skips leading whitespace by default, and Enter is whitespace. Ideally you would be using getline instead of the >> operator: [code=cplusplus] #include <iostream> int main() { const int size = 5; char word[size]; std::cin.getline … | |
Re: >I have tried using system command but to no use. How did you try it? Is this in a separate thread? Does it not work because of a syntax error or something else? Be as specific as possible and give code examples. Otherwise you'll get nothing but stoney silence. >Note … | |
Re: >can anybody give me the cocept of 2d n 3d arrays in c++ The simplest concept I can think of is a 2D array is like a [URL="http://en.wikipedia.org/wiki/Table_%28information%29"]table[/URL], and a 3D array is like a stack of tables. | |
Re: >public static double max(double[]x) This signature suggests that you're supposed to pass an array of doubles to the function and the function returns the largest of them. Your code doesn't do that at all. Use this as your driver: [code=java] public class Problem8 { public static void main(String[] args) { … | |
Re: >It's not a crap Really? Let's take a look: [quote] You should use /**************************/ #include <conio.h> . . . while(!kbhit()); getch(); . . . /*****************************/ to view the pressed key. [/quote] You realize that this totally defeats the purpose of [b]not[/b] using system("pause") for portability reasons, right? conio.h isn't a … | |
Re: >what would you do if you had millions/billions of dollars to spare? The same thing nearly everyone else on Earth would do: spend it selfishly, and maybe donate as little as possible to shut up the people who feel the need to tell me what to do with my money. | |
Re: If you don't ask an actual question, you're not likely to get any help. | |
Re: So, you want [b]us[/b] to give you code for [b]your[/b] project so that [b]you[/b] can get credit for it? Is that what you're saying? | |
Re: We're not a homework service. If you need specific help, we'll be happy to provide it, but if you want us to do it all for you, expect stony silence and/or sarcasm. | |
Re: >friendz plz tell me how to insert time in a running >programme ,which is similar to system clock time. And what are you planning on doing with this time? | |
Re: >p<p+n That's a moving target. Perhaps you meant [ICODE]p < a + n[/ICODE]. | |
Re: >what does the "front" do? A queue allows you to work with both "ends" of the data structure. You enqueue (add items) onto the rear and dequeue (remove items) from the front. This gives you the first-in-first-out behavior of a queue. So, front is used just like rear, except on … | |
Re: To wrap code without highlighting, you say: [code] // Your code here [/code] To wrap code with highlighting, include the name of the language as given in the code snippets section: [code=cplusplus] // Your code here [/code] It's best to avoid the icode tag until you've seen how other people … | |
Re: >Stack<pop> Sf; What do you expect pop to be? >char* ar2 = new char(strlen(ar)); >Scptr.push(ar2); You're allocating memory but not filling it. Try this instead: [code=cplusplus] Stack<char*> Scptr; char ar[] = "abhi"; char* ar2 = new char(std::strlen(ar)); std::strcpy ( ar2, ar ); Scptr.push(ar); cout<<Scptr.pop(); [/code] And be sure to include … | |
Re: >I am wondering if it makes sense that optimizating >with a compiler change the outcome of the solutions. Well, it doesn't make sense, but I can see it happening if your code makes some kind of weird assumption about itself that ends up being optimized into something different. I can't … | |
Re: >I recently read that memory leaks can occur when >using the string stream str() member function You're mixing up two different classes: strstream and stringstream. The former is an ancient class that was part of the old iostream library and should be avoided because it was hard to use correctly. … | |
Re: >For starters, I'll state that I'm not exactly sure what the 'height' of a b-tree represents. The height of a binary search tree is the number of nodes in the longest path to a leaf. >Do you have some ideas? Without recursion you're basically looking at simulated recursion using a … | |
Re: >s.c_str() how it can be this ? c_str is a member function of the basic_string class. Perhaps it would make more sense to you if I said that the std::string class is actually a typedef: [code=cplusplus] typedef std::basic_string<char> string; [/code] | |
Re: >error: Type mismatch in redecleration on 'throw_cards' Post the prototype as well. | |
Re: A map will easily give you the occurrences sorted by the key rather than the count, but you can easily use that to finish up the program: [code=cplusplus] #include <cctype> #include <iostream> #include <map> int main() { std::map<char, int> freq; char ch; while ( std::cin.get ( ch ) ) { … | |
Re: >printf("Number is %d", argv[1]); argv is a collection if strings. If the program is called whatnumber and you type whatnumber 4 to the command line, argv[1] will be the string "4". If you want to get an integer from that, you need to perform a conversion: [code=c] #include <stdio.h> #include … | |
Re: The best way to keep sharp is to answer questions on this forum. Not only do you solidify what you already know by teaching it to others, you're also in a position to be corrected by extremely qualified programmers if you make a mistake. | |
Re: Was your other thread no good enough? |
The End.