506 Posted Topics
Re: [quote=satyanarayanam;362686] 1) How we can convert physical address to virtual adress and vice-versa,for this any linux system call. [/quote] Not related to C++. It depends on the OS and it's memory mgmt algorithms. Check up [url]http://en.wikipedia.org/wiki/Linux#References[/url], I think you'll find some link that explains how Linux does it. [quote=satyanarayanam;362686] 2)How … | |
Re: You could post the "idea" as well.. Ppl will tell you if something is wrong. One I can tell you is: [code=c]if (*array > ave) else if (*array < ave)[/code] Although this is inside the loop it'll always test only the first element of the array. To access other elements … | |
Re: It depends on the data, but simplest answer would be an SQL database. Most/all DBs provide C/C++ APIs for access. You guessed correctly abt STL, its a set of template classes created to make life easier for a programmer, and NOT for the purpose to providing a way storing/accessing huge … | |
Re: Sorry dude, this is way beyond my knowledge of aspect. :). All the best. I presume you've also posted in aspectJ's [URL="http://www.nabble.com/AspectJ-f2216.html"]dedicated forums[/URL].. | |
Re: There is no specific answer to this question, so I'll give you a general one.. First find out what need to be optimized? For this you can use tools like Rational/IBM Quantify (license issues) or Mocking Framework (in this you'll need to write some code of your own). Once you … | |
Re: I think it should work as it is except if you're doing any bitwise operations (or anything else specific to 16-bit arch) on some of the variables. This is because word in 32 bit will be bigger than 16 bit, so all your data will be fine. | |
Re: [quote=roketto;358659]And truth be told I really have no clue what to do except [code]boolean[] deck = new boolean[52];[/code] can anyone give me any insight..? I've no idea where to place it or what else to do.[/quote] Guess you wanna know how to use an array. Here is a crash course: … | |
Re: [quote=CodyOebel;358733]I hope this helps for some of those wanting to create a basic menu.[/quote] I'm sure this was written with good intentions but it has a lot of scope for improvement like some others have also said, I'll add what I can think: 1. It's not portable (like JP said … | |
Re: You don't need a array of 5 ints to store a 5 digit integer. Change the struct to: [code=c] struct person { long phone number; string name; string address; int zip; } [/code] Abt reading from file and storing in struct. Post the code you write to do this and … | |
Re: [code=cplusplus]main() { vector<int> v; vector<int>::iterator it; my_reverse_iterator p(it); }[/code] In this case the problem is clear, you're trying to create an object of a type that's not complete. You need to first create the type by instantiating the template (using template args), only then you can create an object of … | |
A friend in my company recently attended a training titled "LSSD in Java" (LSSD = Large Scale Software Development). The trainer is a guy whom all of us (who attended his other trainings) consider a HUGE SHOT (big shot isn't big enough). Now after 2 days of training guess what … | |
Re: Well, are you trying to write a java program that converts Xmls to DTDs ?! Reason why I ask is it's not a good idea. Do you know what is a DTD used for and what is it's syntax? | |
Re: AFAIK, this is .NET specific terminology, managed means the VM of .NET manages the resources, whereas a pure c, c++ program is called unmanaged as it's expected to take care of it's resources.. | |
Re: Salem says there are compilers that detect such errors. But I suppose you don't have one. [quote=Salem;351310]> >> FILE *stream; >> if(stream = NULL) [B]You're using = where you should be using ==[/B] [/quote] As a good coding practice some ppl (including me) follow a guideline that while comparing a … | |
Re: [quote=Infarction;352907]Orange. It's usually hard to come by, but I have a knack for it in heated discussions :$[/quote] Yeah, me too.. but I'm improving.. I also earned some orange for posting C++ solution to a Java problem.. :$ of course it was unintetional.. :'( | |
Re: Yeah, just use the same methods, you can link to C libraries from a C++ executable as well. I.e. use C apis in C++ code also. I think on unix the apis are in pthread lib if you want POSIX | |
Re: Usually you would save in a file named Prim.java then execute: > javac Prim.java If this gives any compilation errors you'll sove them and do again. Then run it using: > java Prim | |
Re: [quote=Infarction;352912]It matches the type you use when you call it to choose the correct one.[/quote] That's the simple[and corect] answer. If you want to know more [URL="http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc11cplr315.htm"]see this[/URL] or a user friendly [URL="http://msdn2.microsoft.com/en-us/library/tb18a48w%28VS.80%29.aspx"]version by Microsoft[/URL]. :) | |
Re: [quote=dm215;352375]In one particular case, the loop executes no problem (at least according to the debugger, gdb in this case)[/quote] Yeah, that's coz you're unlucky.. :). Simple thing is you shouldn't write code that overflows (particularly when you know it). [quote=dm215;352375]but when I later call a constructor based on "vec" (as … | |
Re: No clue, but I wouldn't exactly call this a C++ problem. May you should check out some graphics forums. | |
Re: Actually there are many ways.. To start with may be this will help: atoi() converts a char* to an int. | |
Hi Guys, I was just reading up Lippman to learn more C++ and came across the third syntax of new operator called "placement new". I have a specific problem where I thot I'll use it, but it turns out to be a total fiasco. :). My requirement is: I need … | |
Re: I don't think there is one standard thing that you can use.. It'll purely depend on requirements.. You can use: - .NET (ASP, VB, VC..) - VC++ - VB - Java+JSP - SOAP I also remember google providing some XML interface for interactive web pages. Not sure if it can … | |
Re: There are other problems.. "Generate 100x4 unique arrays" even rand() won't exactly be rand() if you have a fast enough machine.. Here is one way: [code=C++] void fill_array( int* arr, const int len, const int max ) { vector<int> vi ; //or use set if you like.. srand(time(0)) ; int … | |
Re: That's simple just open the file in notepad and read line by line.. if they are same don't do anything else write them in a single array.. ! | |
Re: [quote=peter_budo;333880]As it is in development all testing is done on my pc where I have all admin rights. Working with Windows XP...[/quote] If that's the case things should've worked. But you say it didn't. Post the errors you got (stack trace...). Problem with Runtime.getRuntime().exec(string_cmd) ; is that string_cmd differs from … | |
Re: They never quit.. Here is the one I got.. :) --------------------- From: Miss Bridgette Zike From: Bitte ---------------------[B] [B]Dear[/B] [/B] 17 Minutes Ago --------------------- Dear lovely one, It is a pleasure to seek an assistant from you and i got the believe that you will help me out successfully but … | |
Re: >> You are given an array of length N, which contains values in the range from 0 to (N^2) - 1. You are to sort it in O(N) time. 2 questions to understand the question: 1. Why does the range of value matter? (size/range of value would have no impact … | |
Re: [quote=Salem;346485]Erm, you use select(), and you post some kind of attempt at using select() so we can figure out where you went wrong. [/quote] Wouldn't select() itself block !? If it does it anyway can't be used for this problem.. from what I know a blocking socket [B]will be[/B] blocking. … | |
Re: Try this: [code=c] char gender ; cout << " What is your gender? (M for Male, F for Female)" << flush ; cin >> gender ; while ( gender != 'M' && gender != 'm' && gender != 'F' && gender != 'f' ) { cout << " Please enter … | |
Re: Sorry I didn't understand anything at all.. ! Hopefully someone else will, and reply.. | |
Re: Here you go... Just fill up the TODO parts and you're done.. [code=c] class matrix { public: matrix() {/*TODO*/} /*TODO implement operator =()*/ void print() {/*TODO*/} }; int main() { matrix m ; m = { {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {1, 0, 0, … | |
Re: Check out google.. [url]http://www.google.co.in/search?q=c%2B%2B+socket+tutorial&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a[/url] | |
Re: You can't take a 2D array as a function argument with both diamentions of variable length (it's allowed for single diamention but not for more than one !) i.e. [code=c] void my_function1( int arr_1D[] ) {/*...*/} //This is allowed void my_function2( int arr_2D[][] ) {/*...*/} //This is NOT allowed [/code] … | |
Re: It's a common error to do: number_of_lines=`wc -l file_name` To be precise: number_of_lines=`wc -l file_name | awk '{print $1}'` | |
Re: >> huj=strtok(NULL, delimeter); [COLOR=Black]This will core, see man strtok.[/COLOR] | |
Re: Not clear whether you have problems in declaring a 2D container or in showing a 2D container's data on a GUI? If it's already been a year since you started on C++ I'm sure you know that a XxY matrix can be represented by: [code=c++] typedef vector<int> ROW_VEC ; vector< … ![]() | |
Re: Yeah, by default first thing you do is [URL="http://en.wikipedia.org/wiki/Array"]check wikipedia[/URL]. :) | |
Re: I don't think it's possible though I'm not 100% sure. Here is what I found in the advanced scripting link I refer to. http://www.tldp.org/LDP/abs/html/parameter-substitution.html#PARAMSUBREF Variable length / Substring removal ${#var} String length (number of characters in $var). For an array, ${#array} is the length of the first element in the … | |
Re: This is the Shell Scripting forum.. | |
Re: [URL="http://www.daniweb.com/techtalkforums/announcement8-2.html"]Read this[/URL]. This is what I'll tell you.. [code=bash] #!/bin/sh hardcoded_folder="xxx" #expected args: # $1: Relative path of file to be checked. (relative to hardcoded path) # $2: Abs path of "another location" # function my_function() { f_2_check=$1 another_location=$2 #if -f $hardcoded_folder/$f_2_check then #file found, so write to another location … | |
Re: >> now how to append the script so tht it now inserts the first argument into the middle of the file and also the original file must retain its original name. Not clear what you wanna do?? append the script => append which script? append TO what? middle of the … | |
Re: Check out other posts in this forum with words "prime" and "number" E.g. [url]http://www.daniweb.com/techtalkforums/showthread.php?t=72218&highlight=prime+number[/url] | |
Re: That's because of the way post-increment works.. it's implemneted something like this: [code=c] int operator++(int a) //post increment (i++) { int tmp = a ; //where "a" is the variable you're incrementing a = a + 1 ; return tmp ; } int operator++(void) //pre increment (++i) { //this is … | |
Re: Usually if the board is not too big reprinting the whole thing (with spaces where you want a number the disappear) does the trick fast enough.. clear the screen before you print of course.. E.g. [code=c]System("clrscr"); printf( "1 2 3" ) ; Sleep(1000) ; System("clrscr"); printf( " 2 3" ) … | |
Re: [code=c++]//to calculate the average of 4 numbers int get4ints() { //function to collect 4 integers int count,*num,number[4]; for(count=0;count<4;count++) { if (count==0) { printf("you are required to enter 4 integers\n"); } printf("enter number\n"); scanf("%d",&number[count]); } //return the value of the first element in the array return *number; } //main program to … | |
Re: write down the algorithm in english first.. algorithm meaning step by step what are you going to do. E.g. it's VERY clear that you have to look at every element in the array at least once, so first step in your algorithm is clear.. | |
Re: If you're developing a compiler or something you need to worry.. otherwise it really doesn't matter that much as a user.. ! | |
Re: You know there is also [url]www.google.com[/url] where you can search for words like "C++ split line" or "C++ tokens"... Or use RWCTokenizer.. |
The End.