53 Posted Topics
Hi there, I want to display images from internal storage into grid view. I have tried this code but i think its for external storage. File file= new File(android.os.Environment.getExternalStorageDirectory(),"image"); Kindly help me I don't have that much experience. Thank you. | |
Hi there, I am stuck in a problem in which my function rounds off a decimal point number upto 4 decimal place and return a 0.0000 number. But when i compare this returned number to 0 it did not return true in if condition. Please check my code below and … | |
Hi everyone, Please check my code below and tell me that why double stores number upto 3 decimal places ? #include <iostream> using namespace std; int main() { double dNo; dNo = 363.430965; cout<<"double no : " <<dNo <<endl; //cout only outputs dNo value upto //3 decimal places return 0; … | |
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 … | |
Hi there, How to set vector size in Class ? I have set vector size at time of daclaration but it does not work. And should we have to deallocate vector memory in destructor ? #include <iostream> #include <vector> //included to use vector using namespace std; class VectorDemo { private: … | |
Hi there, I need explanation for the range of data type say character which is 1byte ranges from -127 to 127 or 0 to 255. I did not understand what it means and how can I check the range of characters. Does it means it can store only values from … | |
Re: It will be very helpful, if you post your code ! | |
Hi there, I am having problem with deallocating string two-dimensional dynamic array. My program works fine but for some conditions such as when row size is greator than column size in 2d dynamic array, the program crashes when it goes into destructor. My program is as follows : #include <iostream> … | |
Hi there, I know this question is very common but I still didn't understand that why we can't check if array is not initialized. Isn't there a way to check an array is initialzed by any values(int, double). I am working on array based program, in which I have to … | |
Hi there, I need getch() type function for int through which I can take input from user, to store it in int variable. I actually want to use in menu from which user selectes any number to call that function to carray that task. Reason of using getch() function is … | |
Hi there, Is there a way to change strings array size on run time. I mean array size initial value is 1, when i run the program, how much user add values array size increases. I have tried following but its not working, please i need a solution in array … | |
Hi there, I have a question related to C++ functions. If a boolean return type function contains too many returns in it, does it cause any problem ?? In my program one of the bool function contains too many return statements, in if conditions. And interesting thing is that it … | |
Hi there, I want to know about wchar_t data type i.e. how it is used and why we use it. And also what is the difference between char and wchar_t. One last thing why we write L before wchar_t initialization. #include <iostream.h> void main() { wchar_t w; w = L'A'; … | |
Hi there, I am implementing simple student class when i run the program it crashes after getting input for char* name. Program is as follows. #include <iostream> using namespace std; class Student { private: char* name; int rollNo; float cgpa; public: Student() { name = ""; rollNo = 0; cgpa … | |
Re: Start writing program where you face problems share the code with us. | |
Hi there, Is there a way to check a variable if it is not initialzed by value ? I need a check for all datatypes. int num; if(!(numIsNotInitialized)) num = 12; else cout<<"num : " <<num <<endl; | |
Hi there, I am implementing the concept of polymorphism and write following program of shapes. #include <iostream> using namespace std; class Shape { protected: double width, height; public: void set(double w, double h) { width = w; height = h; } virtual double get() { return 0; } }; class … | |
Re: Schol-R-LEA is absolutely right ... | |
Re: If I have understood clearly, your problem solution is : #include <iostream> using namespace std; int main() { int researchPro[10]; //input no of research projects //done by 10 students for(int i=0; i<sizeof(researchPro)/sizeof(researchPro[0]); i++) { cout<<"Enter the number of research projects done by students : "<<flush; cin >> researchPro[i]; } int … | |
Re: You can't put comma in floating point variable value whether it is in if condition or in assignment. | |
Re: Read text file from begining solution. #include <iostream> #include <fstream> #include <string> using namespace std; int main() { fstream inputFile; string fileStr; string fileName = "file.txt"; inputFile.open("file.txt"); if(inputFile.is_open()) { cout<<fileName<<" file is open."<<endl; inputFile.seekg(0, ios::beg); //to start reading file from begining while(inputFile.good()) //just for safety { getline(inputFile, fileStr); //read line … | |
Re: You can do this by using do while loop, example is as follows: char repeat; do { cout<<"Hello World !"<<endl; cout<<"\nDo you want to repeat the program(y/n) ?"<<endl; cin >> repeat; }while(repeat == 'y'); | |
Re: Here is the code for simple calculator implemented using switch. #include <iostream> using namespace std; int main() { int num1, num2; //input two numbers for operation like +,-,/,* int sum = 0; char op; //variable for operator cout<<"Enter num 1: "<<flush; cin >> num1; cout<<"Enter num 2: "<<flush; cin >> … | |
Re: Following code count digits in a string. #include <iostream> #include <string> using namespace std; int main() { string str = "hel22lo35Wo4rld"; //string with digits int digitCount = 0; //string is char of array so we will check each char whether it is a digit or not //by using loop for(int … | |
Hi there, I have read that when we create object of a class, its default constructor is automatically called and default constructor assigns default values to variables e.g. to int it assigns 0 and to float it assigns 0.0 ... But I have write a program in which I have … | |
Hi there, What is the easiest way to declare and initialize 2d dynamic array in class in C++ ?? Please tell me the easiest way, I have used 2d dynamic array in Java. Thanks ! | |
Hi there, I need help in making class diagram. What are the attributes of staff of University its behaviours(functions) of staff ?? The attributes which i figured out are name, id, salary, dateOfJoining, qualification. But I can't figure out functions. Anyone please help. | |
Can we access updated public variable of one class in another class without inheritance. Just like below. This class A which have public int variable x. In updateValue function i have updated x value. class A { public: int x; A() { x=0; } void updateValue() { for(int i=1; i<=5; … | |
Hi guys ! I am newbie, I have downloaded oracle 11g release 2 but i don't know where to start and how to connect C# program to database. I want to write simple program of username and password in which I it stored in database. And also maps the username … ![]() | |
Hi there, I am using code blocks and working on bank account programe. I have three classes but just included main function code. My programe works all fine, in which user create account and then deposite initial balance **but before end of do while loop, there is getline function to … | |
Hi everyone, I have a simple problem related to string, but I did not notice before that we can't give space in string input. For exmaple in the following program, take name input from user. If user enter M John, it will skip the enter email input(and the program will … | |
Does any buddy tell me use of asterik in C++ ?? And also explain use of static in methods and in constructors. Actually I am search a code that dynamically creates an object of class. Anyone please help ! class BoxFactory { public: static Box *newBox(const std::string &description) //expalin this … | |
Hi there, How do we differentiate between NULL and zero in C++. I have a program in which i assign NULL to num variable but if i apply if condition to check whether it is NULL or zero. Program still gives me result zero. //num = 0; num = NULL; … | |
Hi everyone, I am stuck in writing Bank Account program. I want that if user wants to create an account, BankAccount class object is created. Then after this i call to its methods such as getBalance() to get the balance in the account. But its not working and I am … | |
In the following program i can't access balance value of parent class in the child class. If the child class can access all attributes and methods of parent class, then why i am getting 0 value when i access parent class balance. Anyone please help, my programming understanding is very … | |
Hi there, Please check my program. When i compile it i am getting error. Cannot find default constructor to initialzie base class. #include <iostream.h> #include <conio.h> class Parent { protected: double num; public: Parent(double n) { num = n; } void sub() { num -= 2.0; cout << "num … | |
Hi everyone, I writing a program in which two methods I want to count when it is called. I don't know how to do this. //parent class void BankAccount::deposit(double dep) { if(dep > 0) balance += dep; } void BankAccount::withdraw(double wd) { if(wd > 0 && wd <= balance) balance … | |
I want to write a simple program to check class and inheritance in Code Blocks but i don't know how to write. I have make new project and add new class named "Car". This is main class. #include <iostream> #include "Car.h" using namespace std; int main() { Car c; return … | |
Hi there, Good day ! I have a question related to private variable in php class. I want to make check if someone accesses private variable, an exception is thrown says "this is private variable" and rest of the excecution of code didn't stop. <?php class myClass { public $str; … | |
hi everyone, I am trying to initialize array in main method, and insert value in array in another method named "popArr()", in last print array in "printArr()" method. But its not working and i am getting errors. The environment i am using borland c++. The code is as follows. #include … | |
Hi, I want to know how to concatenate numbers in C++. int a = 4; int b = 5; int c = a+b; I have tried this but this give me sum of int a and b. I want 4 and 5 concatenate in c variable and give me out … | |
Hello everyone ! I want to get output in C++ in same line. The following code gives me output in separate line. for(int i=0; i<=10; i++) { cout << i <<" " <<endl; } | |
I have div. <div>This is text in div1.</div> How do i get the text written in div to variable in javascript ?? | |
Dear All, I am using cable net, in which they didn't gave me modem. I just plug the cat5 cable into lan to connect to the internet. I have asked them to give me 1mb speed. Does anyone tell me how they control internet speed in network becasue not everyone … | |
Hi everyone, Please help me in rounded border corners. I have generated rounded corner borders from site and it give me five images (four corners and one dot image files). I have set all corners according to that site's description HTML and CSS code. But I can't set bottom right … | |
What does "values", "data" and "field" mean in java ? For example, definition of encapsulation is hiding of data in a class and making this class available only through methods. In this way the chance of making accidental mistakes in changing "values" is minimized. In access specifiers, Java allows us … | |
Hi everyone, I am new in Java programming. I want to know that how to check integer variable whether it is null or not. I have a situation I write a program that asks that how old are you. If a person accidentally press enter and does not put a … | |
Hi everyone, Please check php code below, when i load this page in browser it gives me following errors. "Notice: Undefined index: submit in E:\wamp\www\login\register.php on line 4" "Notice: Undefined index: fullname in E:\wamp\www\login\register.php on line 5" "Notice: Undefined index: username in E:\wamp\www\login\register.php on line 6 "Notice: Undefined index: password … | |
Hi there, I am working on form validation, i want to validate "Name" input field value . I want that in "Name" input field no number can be input. Is there any function which search number/s from string ?? i.e if user inputs any number in that field with string … | |
hi there, If i made flash banner in Adobe Flash CS4, how we add it in website which is based on html and CSS. Thanx |
The End.