- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 4
- Upvoting Members
- 5
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Simple and Sensitive guy
- Interests
- Programming,coding,passionate about things related to computer science.. beside that photography,listening…
48 Posted Topics
Re: why should we not use[inlinecode] system("pause");[/inlinecode] | |
Re: [QUOTE=akiller47;505794]Hi, Im trying to figure out how to display a number from an array where it has been chosen by a random number. [/QUOTE] what are you using to generate randome number ??? the array or the rand function??? what do u exactly want?? [QUOTE=akiller47;505794] Now If the random number … | |
Well i use Dev-c++ 4.9.9.2 for programming..i m using it from last two years...recently i learned java and saw that all java programs are run through command prompt. I tried tha same in c++. i saved my program in dev-cpp/bin .but i am not able to do this..what is the … | |
Re: use [inlinecode]getch()[/inlinecode] to get a character without echoing it on the screen and print * for each entered character..and save each character in a char array [code=c++] char pswrd[20]; int i=0; while((pswrd[i]=getch())!='\r') { cout<<"*"; i++; }[/code] | |
Re: are u talking about RAT IN A MAZE problem...how will the user input the next move...cordinates at the console or click with the mouse..what's the objective actually.. | |
Re: what do you want from user as choice..for what purpose the user have to choose one??? | |
Re: well just to add something... if u have already used a particular data type for somthing and in the middle of ur program u want to use other one for that (just for a particular use) ...then u can use casting .... i.e. changing one data type into other momentarily... | |
Re: sorry to interrupt but i dont understand what the FIRST DIGIT & SECOND DIGIT procedures are doing here...what are u trying to do by calling them in very first few lines of your program. well if you are having assembly course in your college then i will suggest you to … | |
Re: hi... i know how to convert any number into binary....but i dont know which format or mode are u talking about.....u can use the carry bit to output the binary representation of a number...but i think that's so simple and u r talking about something else...i m not getting ur … | |
Re: [QUOTE=sarehu;510617]You'll need a database of cities and their latitude-longitude coordinates, or access to an online database, and you'll need an algorithm for finding the distance between two points on a sphere, given their latitude/longitude coordinates. The latter is done by the haversine formula.[/QUOTE] exactly... this is what i was going … | |
hi! i want to change the icon of an exe file. And the file will be moved from computer so the icon must be embedded in the exe file...is there any way?? the exe file is a daily use application so i want to give it an icon which shows … | |
hi friends... i have some doubt regarding the output at the console. what we generally have is that the output is written on the console and the cursor moves always forward. But what if in some special case we want to back track the cursor a few characters of lines … | |
How to output to an excel file and how to read from it?? i have done the writing part...to use [inlinecode]"\t"[/inlinecode] for moving to next cell in same row and [inlinecode]"\n" [/inlinecode]to move to next row... and is there any special format to save that excel file..because when i save … | |
Re: i do not understand what have you done here... [code=c++] if (gPos != string::npos){ while (gPos != string::npos){ newStr = firstStr.substr(0,i); newStr += firstStr.substr (i + j); }[/code] what is [B]npos[/B]??? on my compiler it is giving a very larg about [B]10 digit number[/B]...and your while loop is [B]indefinite[/B]... | |
I recently saw this function in one of the online test paper i was going through. And i came to know that this is a standard library function but i dont know anything about it. And it is related to some Parent process - Child process kind of things. And … | |
Re: [QUOTE=Ancient Dragon;505697] the line terminator "\r\n" pair in MS-Windows. When using *nix it is only "\n" and MAC its "\r".[/QUOTE] "\r" is for enter key and "\n" is for line feed...correct me if i am wrong.. and if not please tell me what is a line feed?? why it is … | |
Re: new keyword is used for dynamic memory allocation..that's all i see i have seen the second type of declaration in java....haven't seen in c++.. | |
Re: [QUOTE=darkscript;502792]Another one is "C++ Primer", which doesn't require you to know C but it does require you to have programmed before.[/QUOTE] do u have an ebook of that?? if yes please let me know..i want a copy..i will give u my id.. | |
Re: keep counter on each character entered | |
Re: practice is also necessary...keep practicing small problems on the topic you have just read...it will give you better understanding... simply reading from a book is not sufficient... | |
I want to write all the output to the output file and don't want to print on the console output...the file (in which the output has been written) should be opened after i run the program. which function to use for opening a file to see output( at run time)?? … | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: Actually i am not getting what exactly your problem is? but i read your program and i found that there are a lots of loopholes...and i must not give you the required result...so tell me if it is working... You are having a lots of unnecessary vairables and if clauses... … | |
Re: [B]rand()[/B] function just generates random number. it is us who have to decide the range in which we want the random number to be... and taking mod is the easiest way to confine it... general form is ... [inlinecode]rand()%range;[/inlinecode] | |
Re: here it is not effecting where you put the brackets...but take care of brackets when you want to typecast the result of an expression.... example... [inlinecode]Dayoff= (Days)((x+y-5)*z);[/inlinecode] | |
Re: oopss....such a long code.... is evey if statement convertible to switch...isn't it possible only in nested if's not mutually exclusive | |
Re: [B][COLOR="Green"]pass by value...[/COLOR][/B] it just send the value of the variable(one memory location) to the function...and that value is stored in another variable(another memory location) that is declared in the function... [inlinecode]void foo(int b);[/inlinecode] when you call this function from the [B]main [/B]like.. [inlinecode]foo(a);[/inlinecode] the value stored in memory allocated … | |
Re: [QUOTE=zoner7;502149]I figured it out. The function pow does not accept integers, only doubles. I just created my own doubling function. [/QUOTE] the function definition of three_point_dist is wrong i think...is it working... you have written [inlinecode]float Three_Point_Distance[B](x1, x2, y1, y2,[/B] int z1, int z2)[/inlinecode] won't x1,x2,y1,y2 need [B]type specifier[/B]??? [QUOTE=zoner7;502149] … | |
Re: well dont u need to first getText from the guessI textfield and then compare it to the word string... like [code=java] String g=new String(""); g=guessI.getText(); if(g==word) //worked; else //wrong;[/code] i am also new in java...correct me if i am wrong | |
Re: dont know about the standard library function but u can mannualy do it in 2 lines.. [code=java] int days_in_feb=28; if(do it urself....cant help) days_in_feb=29; [/code] | |
Re: vmanes is right.. still if you want to keep both of them (i.e. int and float) then you may check for the '.' decimal in the string using iterators or anything else to traverse the string.... | |
Re: [QUOTE=limac;501806]thanks invisal but, it didn't cause any compilation error but for any number i put in it is showing -1 as the result[/QUOTE] the code given by invisal is absolutely correct.. it must work for you.. and one more thing..in your original code you worked for factorial in a for … | |
Re: write a function for factorial and sum its digits and check for equality...it's simple..isn't it??? do u want a complete code?? if yes then sorry..nobody will help you here for that... | |
Re: In developer c++ u can use hex keyword as shown [inlinecode] cout<<hex<<number; [/inlinecode] | |
Re: you may later cast it to double which will give u the decimal part... | |
Re: correct .. you need to specify string in double quotes...and use double[B] equal to[/B](==) sign to check equality in [B]if()[/B] | |
Re: thanks for the links...they are really useful... but my problem is that i dont know what are [B]commands [/B]to compile and run the cpp program.. ok see [B]steps are[/B] 1.save file in bin 2.run command prompt 3. type in [inlinecode]cd c:\dev-cpp\bin[/inlinecode] now i m in the same directory where the … | |
Re: >Sun website is always best place to search for an tutorial, like now Lesson: Laying Out >Components Within a Container. Have funn reading it NICE....really useful information... | |
Re: [code=c++]for(int i=0 ; i<50 ; i++) {cout<<a[i]<<" "; if(i%10 == 0) cout<<endl; }[/code] you had to use[inlinecode] cout<<endl[/inlinecode] if i is divisble by 10 i.e. 10 elements has been printed.. | |
Re: [code=c++] float x1,x2,y1,y2; cin>>x1>>y1>>x2>>y2; float slope; slope=(y2-y1)/(x2-x1); float c=y1-slope*x1; cout<<"\nThe equation of the line is : y="<<slope<<" x + "<<c<<endl;[/code] is that it?? | |
hi....well this is my first post in this community...i hope people here will help me in my doubts... I am an intermediate level programmer of c++... i have a doubt regarding the permutations of a given string and permutations of first N natural numbers... i have written a program for … | |
![]() | Re: @Ancient Dragon... i want to ask what does clock function return and in what format and with what units(milliseconds/microsec/sec) someone told me in this community that if u want the output in seconds divide the value of clock_t variable by CLOCKS_PER_SEC...and u will get the time in seconds.. I am … |
Re: well both the methods are good....first with the [B]integer array[/B] suggested by gabs and second with [B]structure of two integers[/B] suggested by Slaem... but i think it is better to use the method suggested by your friend...[B]sending two integers by reference...[/B] i guess u dont know about the concept of … | |
Re: @revenge2 i guess you have got the solution to your problem... PS: it's better to use switch in menu-input programs... [code=c++] cin>>choice switch(choice) { case 1: //code for calculate area //output and break; case 2: //code for calculate perimeter //output and break; default: //check for invalid input //ask for re-entering … | |
Re: YEAH... gabs is right....it's simple..u can generate in any range.... what happenes is that rand() generates random number [B]irrespective[/B] of this [B]%n[/B]....anything can be used in place of n.... what we do is just take mod with n so that we can confine our randome number in[B] range 0 to … | |
i m new to java...i made my first applet...a simple applet to showing "THIS IS MY FIRST APPLET"..but it's not working...i m not able to see it in mozilla firefox and IE7... plz help.. the code is here... [B]tryApplet.java[/B] [code=java] import java.awt.Font; import java.awt.Color; import java.awt.Graphics; public class tryApplet extends … | |
i want to calculate the exact run time of my program in [B]seconds[/B]....i used [B]clock() function of time.h library...[/B] what i did is that i made two [B]clock_t [/B]type objects... initialized one of them in the start of main() function and the other in the end.. and calculated the difference..as … | |
Re: well i m not getting what exactly do u want ....u dont want to use do-while but people are suggesting solution with while... what's the big difference???plz explain... anyways i m posting what i would have done :: [code] s.choice=1 while(s.choice) { print_menu(); cin>>s.choice; //you may check for a valid … |
The End.