Posts
 
Reputation
Joined
Last Seen
Ranked #120
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
96% Quality Score
Upvotes Received
253
Posts with Upvotes
194
Upvoting Members
128
Downvotes Received
12
Posts with Downvotes
12
Downvoting Members
5
48 Commented Posts
31 Endorsements
Ranked #49
Ranked #132
~292.27K People Reached
Favorite Tags
c++ x 176
c x 162
java x 64
ruby x 20
Member Avatar for Iceman10284

Design a function named max that accepts two integer values as arguments and returns the value that is greater? For example: if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two …

Member Avatar for UNIQUE_PRINCE
-1
4K
Member Avatar for nitin1

Hi, I am facing an issue in string to const char pointer conversion. I am doing stuff in the fun() but here i am just giving my example. Here it the code: // Helper function string fun() { string abc = "Daniweb"; // print here #1 return abc; } // …

Member Avatar for AssertNull
0
3K
Member Avatar for michael_61

hopefully soone can help me with this lol , this grammar im looking at is kinda tricy and i feel like theres something im missing. im trying to find the first and follow of the below grammar S -> [] | [S] | SS For the first I got: First(S) …

Member Avatar for sepp2k
0
154
Member Avatar for PCSAWICK829

Alright. I'm teaching myself python from 'Learn Python the Hard Way: 3rd Edition' by Zed Shaw.. it's been informative so far. Definitely learning. After his lessons, he gives study drills, extra project to put your learning to use. He challenged us to: "Find out what Zork and Adventure were. Try …

Member Avatar for Conrad_2
0
9K
Member Avatar for Altjen_1

I am designing a software and want to save data in a txt file. but dont want the user to open them as txt file, only the app should do it. Is this possible? if yes, how? I've searched in google, but not any good reason to help me out.

Member Avatar for tinstaafl
0
1K
Member Avatar for chubbyy.putto

I know I should have try it first but I dont understand what is this asking about. My english is my very bad. Can you please telling in easy english. PLus this is very confusing. Please help me out Write a BNF grammar for the for statement of C. Assume …

Member Avatar for sepp2k
0
682
Member Avatar for sciprog22

Hello, I have a question about ascending order sorting using the Comparabe interface: When I add the keys of my Hash Map to a TreeSet object and implement the compareTo as below, I get descending order of sorting of names: public int compareTo (Accounts a) { return a.name.compareTo(this.name); } // …

Member Avatar for sciprog22
0
162
Member Avatar for abdullah_8

public class adding public class adding { public static void main(string[] args){ { int a=1; int b=2; sum c=a+b; system.out.println c;(sum c)-> } } help illegal start of expressions

Member Avatar for abdullah_8
0
153
Member Avatar for Cory_1

I am writing a program for extra practice from my book on finding the max element in array using Java Generics. My Code so far is: public class GenericMax { public static void main(String[] args) { Integer[] numbers = {1, 2, 3}; //Creates array of integers System.out.println(max(numbers)); String[] words = …

Member Avatar for JamesCherrill
0
6K
Member Avatar for MrXortex

I have created an app with simple login authentication, it is actually a twitter clone. The user logs in and access the pages, etc. But when the user posts something from there profile. It gives an error NoMethodError in RibbitsController#create undefined method `userid=' The error is around line 5: class …

Member Avatar for Taywin
0
622
Member Avatar for Siberian

I have a question about programming/scripting in general, which I'm still driving over rocky terrian trying to learn. The compiler, regardless what it is; reads though code from top to bottom, does it read though all the lines of code first, or does it stop at functions etc and continue …

Member Avatar for Rashakil Fol
0
342
Member Avatar for Mahnoor_1

I have a little confusion in my mind. I know very well the difference between preincrement and postincrement, postdecrement and predecrement. But i wonder how do these operators work during loop. I ,myself, use postincrement or decrement in loop as follows: for(int i=0;i<5;i++) { //code } But in my book …

Member Avatar for Mahnoor_1
0
267
Member Avatar for laguardian

Hello guys! I'm working a project and it seems that there's something wrong with my switch-case. For example, in the user menu, the user can input the number 2 then it would allow them to deposit, but somehow, it keeps displaying the first switch-case. switch(resp){ case 1: users.get(0).displayProfile(); users.get(0).editProfile(); break; …

Member Avatar for stultuske
0
207
Member Avatar for ravi_14

assume latgeInt=2147483647 Debug.Log(largeInt); //2147483647 float largeFloat = largeInt; Debug.Log(largeFloat); ///2.147484E+09 int backAgain = (int)largeFloat; Debug.Log(backAgain); //-2147483648 *This part i did not get. I assume there was some data loss when float was explicitly casted into int . But the loss should be in right most digits. How come sign got …

Member Avatar for sandeepjkl
0
205
Member Avatar for hadisur_rahman

int main() { int a=10; printf("%d",a); return 0; or return a; } # 1ts question:In the program Why you used 0 in return 0 ; and 2nd question : if you use a in return a; then it also print the correct output but why ? #

Member Avatar for sepp2k
0
275
Member Avatar for Ahmed_62

public static boolean isEmpty(int grid[][]) { for (int r = 0; r < grid.length; r++) for (int c = 0; c < grid.length; c++) if (grid[r][c]==0) { return true; } return false; } the question is : after returning true it back to (for loop) or not ????

Member Avatar for stultuske
0
156
Member Avatar for new_developer

Hi everyone, My program is crashing on taking input of alpha-numeric and store it in char[]. I don't know why, please anyone help ! sample input : C9H8O4MgOH #include <iostream> #include <string.h> using namespace std; bool hydroxide(char[]); int main() { char formula[] = ""; cout<<"Enter chemical formula : "; cin …

Member Avatar for Mayukh_1
0
226
Member Avatar for Ihteshamullhaq

#include <iostream> using namespace std; main() { int matrix[2][2]; for (int i = 0; i<=2; i++) { for (int j = 0; j<=2; j++) { cout <<"Please Enter matrix "<<i<<"th row and "<<j<<"th Column "; cin >>matrix[i][j]; } } //Display the Matrix for (int i = 0; i <= 2; …

Member Avatar for basit_3
0
122
Member Avatar for niski

Hey guys, I've started building a program for college, everything was running really smooth and I've started to pick things up in the past couple days, but for the life of me I cannot find where I have a syntax error, neither can my friends :/ I've tried looking up …

Member Avatar for niski
0
210
Member Avatar for nitin1

I read many articles on Web regarding this. I am able to understand what static_cast does. I am not to properly understand why, and when we have to dynamic cast. There is something "we can downcast the pointer when it is polymorphic". I am not able to understand what they …

Member Avatar for mike_2000_17
0
5K
Member Avatar for nitin1

Hi, I am learning Git system these days. I have made a new folder in ubuntu and in terminal did this: 1. git init 2. then made a file testfile1.txt 3. then made a branch using "git branch newbranch" 4. then checkout to this branch. 5. then, made a new …

Member Avatar for sepp2k
0
202
Member Avatar for Baalla

What are the differences between NP vs NP-Complete vs NP-Hard ? I am aware of many resources all over the web. I'd like to read your explanations to undrestand better

Member Avatar for Schol-R-LEA
0
238
Member Avatar for Aeonix

I tried to build really basic associative array but it turned out I don't have enough knowledge, so I tried something less, and less, and less, because I kept failing at it. Finally I just tried to set variables and print them in the command-line. But I can't even do …

Member Avatar for Aeonix
0
22K
Member Avatar for XodoX

Hello, how does an Interpreter work ? I read up on it and it seems you just parse each line and then (somehow) execute the lines. I suppose the code needs instructions on how to execute each line ?

Member Avatar for sepp2k
0
117
Member Avatar for Sarkurd

Hi It's been a while i'm learing C++ but still i have some issue with `Move semantics` and some other stuff. I wrote this class but i don't know why the `Copy constructor` is getting called and the output is a little strange to me, shouldn't the `Move Constructor` gets …

Member Avatar for Sarkurd
0
275
Member Avatar for davidbr

I have this code which if i press msgbox yes it opens another frame but if i do same thing from another function (counter) i get an error. Can someone help me and tell what is wrong? import tkMessageBox import Tkinter as tk from Tkinter import * from functools import …

Member Avatar for sepp2k
0
205
Member Avatar for hadisur_rahman

# Is {(1,1), (2,2), (3,3)} symmetric? transitive? Yes! Yes! ## Why is R = {(1,2), (2,3), (1,3), (2,1)} not transitive? Because (1,1) and (2,2) are missing. ## #

Member Avatar for sepp2k
0
154
Member Avatar for CattleOfRa

I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown below: #include<iostream> int DoubleOf(int n); int main() { std::cout << "Double of 5 is " << DoubleOf(5); return 0; } …

Member Avatar for sepp2k
0
190
Member Avatar for Clearner123

Hi, I have this doubt i have read that "We must declare c to be a type big enough to hold any value that getchar returns We can't use char since c must be big enough to hold EOF in addition to any possible char. Therefore we use int." it …

Member Avatar for Clearner123
0
127
Member Avatar for zxz

Hi everyone and good morning :) . i want to simply read from the linux file "urandom" a random number and print it out on screen.just simple as that. this function should be in a file called myrandom.c ( myrandom.h must be made also, which has my function dekleration ) …

Member Avatar for zxz
0
3K