506 Posted Topics
Re: 1. References are similar to pointers. But not same. That's why the std committee came up with 2 different things. :). 2. "references same as a constant pointer to a variable" => Yes, a reference and a const ptr to a var would work "almost" same way (you'll use different … | |
Re: May be you have an old .class file in your path. Check by explicitly setting the classpath OR passing it on command line OR running on a different machine/window. | |
Re: See man fstat fstat gives you struct stat for a given file. This struct has following info abt your file: [code=c] mode_t st_mode; /* File mode (see mknod(2)) */ ino_t st_ino; /* Inode number */ dev_t st_dev; /* ID of device containing */ /* a directory entry for this file … | |
Re: > Or should I figure out how to use Visual Studio to do it? >> Visual Studio won't do it for you since its an IDE, not a language. Standard C++ has no inbuilt support for GUI, Networking and the likes. You have to resort to third party libraries. I … | |
Re: (assuming you're talking abt HTTP Sessions) AFAIK they are stored in memory and not serialized to any normal flat file. (although you might wanna check if HttpSession class implements serialize or not) | |
Re: >> "thanks a lot!!!" If you know teh question and the answer, "you're welcome".. | |
Donno how many of you know abt this but it's one of the best time pass I've come across.. Created by some of IIM-I guys (Indian Institute of Management - Indore) it is simply-too-good.. Original [URL="http://www.iimi-iris.com/iris/irising/klueLESS/"]KlueLess Part 1[/URL]. Don't forget to [URL="http://www.iimi-iris.com/iris/irising/klueLESS/game.asp"]read the rules[/URL] without which you won't get anywhere. … | |
Re: Don't forget to get a compiler and do the exercises. :) You can find a lot of them in a sticky thread at the top of this forum. It's a nice collection to get started on almost all aspects of C++. | |
Re: Donno exactly what you wanna know abt the 2 methods but in simplest words when applies to a tree structure with say 3 levels: BFS: Will test all nodes on one level before moving on to the next level. DFS: will test all child nodes of the all levels belonging … | |
Re: Just reformat the code and the error will be glaring in your face. Use Astyle e.g. Also use the code tags: [code=java]class waiters { private double tab; public waiters(String name); { System.out.println("my name is"+name+",i''ll be your waiter!"); tab = 0.0; } public double priceof(String s) { double price; if(s.equals("chicken")) { … | |
Re: A few comments: 1. Given it's C++ problem, try using C++ containers (instead of array) e.g. vector/list/map. 2. You don't really need to force use of a design. Not yet at least. 3. Comment on the design: Class Data should not be responsible for insertion/deletion/.. Look at it purely from … | |
Re: AFAIK these are the famous/unbeatable/the-best books on this topic: The Art of Computer Programming by Donald E. Knuth It has 4 volumes: Art of Computer Programming, Volume 1: Fundamental Algorithms Art of Computer Programming, Volume 2: Seminumerical Algorithms Art of Computer Programming, Volume 4, Fascicle 2: Generating All Tuples and … | |
Re: If you need to get the name locally (your program runs on the machine whose name you want to get) you can use gethostname, see [URL="http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c2487/"]this example[/URL]. If you need to do it remotely (your program runs on one single machine and needs to get names of all machines in … | |
Re: Can you post declaration/definition of IDI_APPLICATION ? | |
Re: [quote=vijayan121;387507]members or base class sub-objects cannot be initialized inside the body of the constructor; they can only be assigned to. initialization is always before the body of the constructor executes.[/quote]Think that answers the question adequately. Just to be clearer.. the difference between initialization and assignment is: 1. Initialization is done … | |
Re: Donno of any tutorials purely for gaming purpose.. I'm sure you'll find lotsa threads talking abt problems with gaming here.. I would suggest that you pick an idea from one of those and start off.. What you'll need to learn of course is user I/O which you say already know.. … | |
Re: Does this help ? [code=bash] #!/bin/bash file_with_workstations_list=/tmp/input_list.txt while read workstation_name do #do you stuff with workstation_name echo "Read workstation name: " $workstation_name done < $file_with_workstations_list [/code] | |
Re: Not clear what's the problem? What's meant by "so that users can execute those by keeping the script inside the sudo menu" ? | |
Re: 1. You set the umask using umask command. 2. If you want to set "default" umask you add appropriate command (e.g. umask 002) in some initialization script. E.g. .profile or .bashrc etc. 3. Why? Well, in some companies they have VERY strict access controls, they don't want anyone to be … | |
Re: What in the name of thundering blisters you think guys here are for ? Do you work ?!! Post your code if you have a problem.. We're here to "help you do it" not "do it".. | |
Re: With the special divine powers bestowed upon me I can see your makefile and see that on line number 3351 you have an extra comma which is causing this error. Remove it and it should work. | |
Re: You could consider [mis]using logadm. See "man logadm" It gives you all that you need. | |
Re: Google it ! Here is the first result.. [url]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=849851&SiteID=1[/url] | |
Re: Just wondering that after #including vector/list etc, why are you using C-style array for this? Use C++ array (i.e. vector) instead, life is so much more easy. [code=cplusplus] #include <iostream> #include <list> #include <iterator> #include <vector> using namespace std; class humanPlayer { public: humanPlayer(string thePlayersName, unsigned int thePlayersTurnNum); ~humanPlayer(){}; void … | |
Re: Check out [URL="http://www.daniweb.com/techtalkforums/post332703.html#post332703"]this thread[/URL] also might be helpful for you.. | |
Re: What happens when you run this query directly from sqlplus? [COLOR=#000000]select loginbean0_.user_name as user1_5_, loginbean0_.user_password as user2_5_, loginbean0_.user_status as user3_5_, loginbean0_.user_role as user4_5_, loginbean0_.user_created_id as user5_5_, loginbean0_.user_created_date as user6_5_, loginbean0_.user_updated_id as user7_5_, loginbean0_.user_updated_date as user8_5_ from user_admin loginbean0_ where loginbean0_.user_name=? and loginbean0_.user_password=?[/COLOR] | |
Re: Another possibility is to accept input using 3 separate cout+cin, which might be easier for you. Although for sake of learning string parsing basics you should try what AD suggested.. One comment on AD's code: Default values, [U]usually[/U], should be invalid values e.g. Angle(int d = 361, double m = … | |
Re: [quote=kinggarden;381316]I mean where the compilier starts to compile the project and how it goes through the whole project and turn it to assembly codes. [/quote]Here is an excerpt from one of the old presentations I gave, may that should answer this question: -------------------------------------- The life cycle of a C++ program … | |
Re: I don't know if code master flex is around anymore.. :) You've picked up a real old thread.. Have you checked [url]http://en.wikipedia.org/wiki/Binary_tree[/url] | |
Re: google for getrusage, here is [URL="http://man.he.net/man2/getrusage"]one link[/URL]. | |
Re: Another difference is #define doesn't translate any memory allocation, whereas a const variable will cost some memory. There is a third way for constants, use enums. [code]enum { X = 100 } ;[/code] It's comparatively typesafe and doesn't use any memory. Restriction is of course that you can use it … | |
Re: Heard of Unix aliases ?! If you don't wanna do that, you can also say x="that whole command" and then $x | |
Re: [URL="http://www.google.com/search?q=C%2B%2B+functions+tutorial"]STFW[/URL] ! Here are the first few links: [url]www.cplusplus.com/doc/[/url][B]tutorial[/B]/[B]functions[/B].html [url]www.cprogramming.com/[/url][B]tutorial[/B]/lesson4.html | |
Re: If you just wanna create file without any contents use the command that is meant for it. :) Use "mkfile", or simply "touch" if you don't wanna complicate things. If you want to write something in the file use redirection. Finally, next time you might wanna use Unix Shell Scripting … | |
Re: AFAIK you can put @ in front of any command. And it'll be supressed. To suppress it's output as well, redirect to /dev/null or a file. | |
Re: As already described by AD library calls are calls to functions/APIs exposed /exported by libraries (*.dll+*.lib in windows, *.so and *.a in Unix). System calls are calling basic OS functions/APIs. As most system APIs are provided by OS in form of libraries most system calls are library calls. The library … | |
Re: What are you tryin to do ? also provide some sample output (also expected output if possible).. | |
Re: Or in case you've by mistake posted this in C instead of C++ the prototype of interest would be [code]void foo(int& prm1, int& prm2, int& prm3);[/code] | |
Re: [quote=joeprogrammer;370115]> [B] Better [/B]yet, instead of using the [] as vector accessors, use std::iterator.[/quote] Probably to learn iterators. But otherwise vector being the C++ array one should use the subscript operator for accessing rather than iterator. It's faster. | |
Re: [quote=Aia;369552]Just one of many ways of doing it: [/quote] I'm sure your intentions are good but [URL="http://www.daniweb.com/techtalkforums/thread78060.html"]don't post the complete solutions[/URL]. | |
Re: Do you know what a palindrome is ? | |
Re: It's pretty simple first create a binary tree, then read the input and insert each element in appropriate place in teh tree, then read it back in postfix notation. Let us know once you're done with the code if you need more help. ![]() | |
Re: [quote=jaepi;364125]but it's not working...[/quote] Something more than "it's not working" is always more helpful :) A few things I can think of are: - isnan() should be used when you have doubts abt the integrity of the number (you know it's a number already, but may not be represeted correctly … | |
Re: Sounds very specific requirement. Donno if some free (of cost) library available for this. May be there is some licensed one. | |
Re: Reset variable count when you're reusing s and q variables. I.e. do count = 0; as the first thing inside the outer most do-while loop. Problem is because you haven't reset this variable on second attempt you're popping more elements than you pushed. So when you pop on an empty … | |
Re: Of course.. let the machine do your job. :) Compilers provide options to generate optimized for a given hardware (it optimizes using the full instruction set of that hardware). I have no idea abt the ARM processor you mentioned but check your compiler's manual if it provides any option for … | |
Re: [quote=Ancient Dragon;363638]remove the "\n"s -- that is only for cout. Not allowed to have literals (text in quotes) on the cin line.[/quote] There is some syntax of cin that allowes us to ignore the \ns.. Isn't it? | |
Re: True, but I think the msg is put in many places (like [URL="http://www.daniweb.com/techtalkforums/announcement8-2.html"]this [/URL]and [URL="http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized"]this[/URL]).. Not that I mind it once more as a sticky thread.. :).. It's one of [B]the[/B] reasons why I came to Daniweb.. Also it works both ways, even ppl who are helping should keep in … | |
Re: You can use stat or diropen.. See man pages.. | |
Re: [quote=srinath.sec;363442] 1) how can we change the value of a macro during compilation time tell me with an example [/quote] Undefine the macro and define it again. E.g. [CODE]#undef SOMEONE_ELSE_S_MACRO #define SOMEONE_ELSE_S_MACRO(p1, p2) myfunction_call()[/CODE] Note: 1. assumed that SOMEONE_ELSE_S_MACRO is defined in already in your .c file OR one of … |
The End.