- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
25 Posted Topics
Re: #ifndef CAR_H #define CAR_H class Car { private: int year_; std::string make_; int speed_; public: explicit Car(){} explicit Car(int year, std::string make):year_(year),make_(make){ speed_= 0;} int getYear() { return year_; } std::string getMake() { return make_; } int getSpeed() { return speed_; } void Accelerate() { speed_ +=5; } void Brake() … | |
Hi I make a layout-land folder and make a main.xml.It should show the layout when I change the layout to landscape but it is showing the original layout. this the code of main.xml in layout-land <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="sudesh"/> </LinearLayout> and this is the code of … | |
Hi I am writing a php program, it gives the error "parse error syntax error unexpected t_constant_encapsed_string expecting ']' " the code is <a href="blog.php?id=<?php echo $article['_id']; ?>">View </a> any suggestion? | |
Hi I have two edittexts and I have to generate random no and randomly show in one of two edittexts. generating random no is ok,but randomly showing in one of the edittext, I donot have any idea. if any one have any hint or any arrticle.,Please help | |
I wrote my first trigger and it giving error UES TRY GO CREATE TRIGGER cust_update ON TRY FOR UPDATE AS IF UPDATE (custno) BEGIN TRANSACTION RAISERROR('CUST NO CANNOT BE UPDATED',10,1) ROLLBACK TRANSACTION END Any idea ` | |
A PHP Error was encountered Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string Filename: libraries/Parser.php Line Number: 101 the code id <?php foreach($query->result() as $rows): ?> <?php echo $rows->title; ?> <?php endforeach; ?> Any solution. | |
//Given the following program , what is the output for each of the numbered lines in main() #include <iostream> using namespace std; class X{ public: X() { cerr << "X()|";} X (const X&) { cerr << "X(const X&)|";} ~X() { cerr << "~X()|";} X &operator=(const X&) { cerr << "X::op=|"; … | |
#ifndef BASE_H #define BASE_H class Base { public: int m_nValue; Base(int nValue=0) : m_nValue(nValue) { std::cout << "Base" << std::endl; } }; #endif #ifndef DERIVED_H #define DERIVED_H #include "Base.h" class Derived: public Base { public: double m_dValue; Derived(double dValue=0.0) : m_dValue(dValue) { std::cout << "derived se" << std::endl; } friend … | |
I have written this code to find the cycle in graph public boolean hasCycle(int i, int[][] mat) { visited[i] = 1; // for( int i = 0; i < numNodes; i++ ) for (int j = 1; j < mat.length; j++) { if (mat[i][j] == 1 && i != j) … | |
#include <string> #include <iostream> #ifndef NAME_H #define NAME_H class Name { private: std::string first_,last_ ; public: explicit Name(const std::string & first = "john", const std::string & last = "doc"):first_(first),last_(last) { if(!isvalidlast(last_) || isvalidfirst(first_)) throw "Name :: Name(const string &,const string &):invalid Name"; } static bool isvalidlast(const std::string & last){} static … | |
This is my output { { d: { a e } } { e: { b c d } } { b: { a e } } { c: { a e } } { a: { b c d } } } I used this to_string to print this … | |
How to sort vector<int> v{3,2,7,6,5,8,1,2,3,4,5}; in decreasing order using function object. I did using lambda expression sort(v.begin(),v.end(),[](int a , int b){return a > b;}); But How we do using fn object | |
int main() { map<string,size_t> count; string word; while(cin >> word) count[word]++; --------(1) for(auto it=count.begin();it!=count.end();++it) cout << it->first << ": "<< it ->second <<endl; I donot understand the code particularly the line (1) Could anyone can explainÉ | |
Hi When I tried to compile like g++ -std=c++11 -W -Wall it gives this error error: ‘stoi’ is not a member of ‘std’ #include <string> #include <iostream> #include <fstream> class Grade { public: // Default Constructor Grade() {}; // Functors // If the given course and the score matches the … | |
implement a generic fn mapf with prototype template<class Sequence c , class UnaryFunction) Sequence mapf(Sequence c , UnaryFunction f) for ex if c is a seq containing the seq (3,2,7,6,8) and f is the fn that returns twice it integer agument. then container returned by mafc(c,f) is a list containing … | |
given int a[]= {3,2,7,6,8,1,4,5} vector<int> v(a,a+8) use the stl copy algorithm to display the last 5 integers in the vector to cout with each integer on a seperate line. copy takes three argument. third argument is output container. In this case it is v.but v already have 8 elemenst. How … | |
I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { //cout << "ssss"; //continue; //} sum += f; count ++; cout << fixed << f … | |
I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { istringstream iss(f); if(!(iss(f)) { iss.clear(); continue; } sum += f; count ++; cout << fixed … | |
How to know the name of process in the other process? or who started that process. | |
In my program the commands are on left hand side , I want to move thses buttons to middle of window on click of mouse. I wrote this code n=but buttons are disappearing. Any solution case WM_LBUTTONDOWN: RECT buttonScreenRect; GetWindowRect(hButton, &buttonScreenRect); POINT buttonClientPoint; //buttonClientPoint.x = hButton.left; buttonClientPoint.x = buttonScreenRect.left; buttonClientPoint.y … | |
I have to write a fn squeeze(const string &s, char c) for ex squeeze("haaaaah" , 'a') should give the output hah | |
I have to find the permutation of vector of integers. I need to implement and interleave function vector<vector<int> > interleave(int x , const vector<int> & v); Using interleave we can implement a permute function. vector<vector<int> > permute(size_t n); that returns a vector containing of the first n positive nos. I … | |
How to create a rubber banding line using the left-mouse button in win 32? | |
I have to write a program in which i have to remove from a string another string if it found. for ex "I am going to school" and second string is "cho" i have to remove cho from first. the output should be "I am going to sol" need help | |
Write a minimal terminal emulator which will basically just transmit all characters typed on the keyboard to the serial port and display all characters received via the serial port. Include a set of menu items that will allow a user to: Select, modify or set the communication parameters such … |
The End.