No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
hi, i opened two mysql sessions(A,B) and set the autocommit variable to 0 for both the sessions. by giving "set autocommit=0" then in session A i added a row to my table by calling a stored procedure and i tried doing the same in session B also.. but in session … | |
how do i find the foreign key and primary key constraints of a particular table through a sql query? | |
hi, i am getting a "no database selected error" when i give the following command.. mysql>source company_data.sql ERROR 1046 (3D000):No database selected pls help me out with this error!! | |
i gave the copy constructor in the below code just to know when will it be called.. [CODE] #include<iostream> using namespace std; class counter { int val; public: ~counter() { cout<<"destructor"<<endl; } counter(counter&) { cout<<"copy constructor called"<<endl; } counter():val(0) {} counter& operator++() { ++val; *this; } int getval() { return … | |
hi, i created a linked list. it just adds values to the list called "source" and copies it to another list called "destination", it also deletes the values which is found in the source list and prints the source list again. link_list.h [CODE] #ifndef LINK_LIST_H #define LINK_LIST_H class link_list { … | |
[CODE] #include<iostream> using namespace std; int main() { int* p=new int[2]; p[0]=1; p[1]=2; cout<<p[0]<<" "<<&p[0]<<endl; cout<<p[1]<<" "<<&p[1]<<endl; cout<<endl; cout<<*p<<" "<<p<<endl; p++; cout<<*p<<" "<<p<<endl; delete [] p; } [/CODE] the output of the above program is : 1 0xe502f0 2 0xe502f4 1 0xe502f0 2 0xe502f4 aborted(core dumped) can anyone pls tell … | |
[CODE] #include<iostream> #include<fstream> using namespace std; int main() { char a='p'; int b=23; float c=45.67; ofstream out("test.txt"); out<<a<<" "<<&a<<endl; out<<b<<" "<<&b<<endl; out<<c<<" "<<&c<<endl; } [/CODE] the output for this is in the text file: p pα#a/ 23 0x22cd08 45.67 0x22cd04 why is the address of the character variable is very … | |
this is my header file.. sorted_list.h class sorted_list { private: class list_link { private: int key; // identifies the data double value; // the data stored class list_link* next; // a pointer to the next data public: list_link(int,double,list_link*); ~list_link(); }; class list_link* first; public: sorted_list(); ~sorted_list(); void insert(int key, double … | |
struct list_link { int key; // identifies the data double value; // the data stored struct list_link* next; // a pointer to the next data }; struct list_link* create(int key, double value, struct list_link* next) { return 0; } the "struct list_link" contains two variables and a pointer. what exactly … | |
the following is the code... #include<iostream> #include<iomanip> using namespace std; int main() { float start_temp,stop_temp; float step,F,C; cout<<"start temperature:"; cin>>start_temp; cout<<"stop temperature:"; cin>>stop_temp; cout<<"step temperature:"; cin>>step; float i=0; cout<<setw(10)<<"celsius"<<setw(15)<<"fahrenheit"<<endl; cout<<setw(25)<<"celsius"<<setw(15)<<"fahrenheit"<<endl; for(i=start_temp;i<=stop_temp;i=i+step) { C=(5.0/9.0)*(i-32); F=32+(9.0/5.0)*i; cout<<setprecision(2); cout.setf(ios::fixed); cout<<setw(10)<<C<<setw(10)<<i<<setw(10)<<F<<endl; } } and the output for the above code is: start temperature: 0 … | |
hi , i saw the following link [url]http://www.cplusplus.com/reference/iostream/manipulators/setprecision/[/url] and tried it in the same way... #include<iostream> #include<iomanip> using namespace std; int main() { float a=3.14; cout<<fixed<<setprecision(4)<<a; } so my output should be:3.1400. but when i execute the above code.. i am getting the error as fixed undeclared.. | |
hi i am trying to use setw with a string.. here is my code.. [CODE]string a="hello"; cout<<setw(10)<<a;[/CODE] i inserted string header and iomanip header files... now my output should be with a few number of blank spaces and then it should print hello.. but its not working for me... could … |