506 Posted Topics

Member Avatar for satyanarayanam

[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 …

Member Avatar for thekashyap
0
120
Member Avatar for shmay

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 …

Member Avatar for shmay
0
148
Member Avatar for SelArom

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 …

Member Avatar for ~s.o.s~
0
177
Member Avatar for lucky1981_iway

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]..

Member Avatar for lucky1981_iway
0
83
Member Avatar for rinko

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 …

Member Avatar for thekashyap
0
288
Member Avatar for sushanttambare

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.

Member Avatar for Ancient Dragon
0
105
Member Avatar for roketto

[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: …

Member Avatar for thekashyap
0
2K
Member Avatar for CodyOebel

[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 …

Member Avatar for CodyOebel
0
99
Member Avatar for pulse0

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 …

Member Avatar for John A
0
245
Member Avatar for jrivera

[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 …

Member Avatar for vijayan121
0
1K
Member Avatar for thekashyap

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 …

Member Avatar for EnderX
0
166
Member Avatar for dami06

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?

Member Avatar for ausgezeichnete
0
909
Member Avatar for PancoMaan

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..

Member Avatar for PancoMaan
0
83
Member Avatar for fightfox06

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 …

Member Avatar for thekashyap
0
157
Member Avatar for jamello

[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.. :'(

Member Avatar for jamello
1
280
Member Avatar for jhdobbins

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

Member Avatar for ndeniche
0
310
Member Avatar for pplteo

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

Member Avatar for thekashyap
0
89
Member Avatar for adam37

[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]. :)

Member Avatar for thekashyap
0
121
Member Avatar for dm215

[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 …

Member Avatar for thekashyap
0
160
Member Avatar for Luckychap

No clue, but I wouldn't exactly call this a C++ problem. May you should check out some graphics forums.

Member Avatar for thekashyap
0
122
Member Avatar for Mac.Z

Actually there are many ways.. To start with may be this will help: atoi() converts a char* to an int.

Member Avatar for Mac.Z
0
318
Member Avatar for thekashyap

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 …

Member Avatar for vijayan121
0
306
Member Avatar for shibam

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 …

Member Avatar for shibam
0
110
Member Avatar for Reema_Hamed

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 …

Member Avatar for Reema_Hamed
0
188
Member Avatar for sundarN

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.. !

Member Avatar for Lerner
0
62
Member Avatar for peter_budo

[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 …

Member Avatar for uh63
0
2K
Member Avatar for dcc

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 …

Member Avatar for happygeek
0
133
Member Avatar for Direwolf007

>> 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 …

Member Avatar for Direwolf007
0
181
Member Avatar for Savs

[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. …

Member Avatar for Savs
0
124
Member Avatar for stonecoldstevea

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 …

Member Avatar for thekashyap
0
271
Member Avatar for squinx22

Sorry I didn't understand anything at all.. ! Hopefully someone else will, and reply..

Member Avatar for thekashyap
0
115
Member Avatar for inorbit

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, …

Member Avatar for thekashyap
0
96
Member Avatar for MukeshZ

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]

Member Avatar for Salem
0
206
Member Avatar for ganesh_c

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] …

Member Avatar for Salem
0
197
Member Avatar for jamshid

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}'`

Member Avatar for jamshid
0
93
Member Avatar for pulse0
Member Avatar for rapperhuj
Member Avatar for the_glitch

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< …

Member Avatar for iamthwee
0
230
Member Avatar for naya22

Yeah, by default first thing you do is [URL="http://en.wikipedia.org/wiki/Array"]check wikipedia[/URL]. :)

Member Avatar for Matt Tacular
0
79
Member Avatar for kaitlyn

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 …

Member Avatar for thekashyap
0
96
Member Avatar for ryanokc
Member Avatar for PrabhuScript

[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 …

Member Avatar for thekashyap
0
88
Member Avatar for dianabippu

>> 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 …

Member Avatar for thekashyap
0
114
Member Avatar for addicted

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]

Member Avatar for thekashyap
0
91
Member Avatar for mailsteam

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 …

Member Avatar for deng_cen
0
196
Member Avatar for it_dude

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" ) …

Member Avatar for thekashyap
0
94
Member Avatar for kemboy

[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 …

Member Avatar for WaltP
-1
280
Member Avatar for raj157

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..

Member Avatar for raj157
0
106
Member Avatar for Mpiangu

If you're developing a compiler or something you need to worry.. otherwise it really doesn't matter that much as a user.. !

Member Avatar for jwenting
0
127
Member Avatar for B.Y

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..

Member Avatar for WaltP
0
10K

The End.