49,757 Topics
| |
It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. For example, strings //usr///local//nginx/sbin// and /usr/local/nginx///sbi n are equivalent. The character '/' (or some sequence of such characters) at the end of the path is required only in case of … | |
Ok, I hope this is the right place for his kind of disccusion. I assume that this kind of question is rather apsurd but I may get killed for this. I have had expirience with both java and c++ but non in field of system programming. I am finishing my … | |
here is the question: The series of numbers: 1, 1, 2, 3, 5, 8, 13, 21, ….is known as Fibonacci series. Each number is the sum of the two preceding numbers. Write a C++ program that writes the first 5 Fibonacci numbers to a file fibnos.txt (in your local drive). … | |
I'm trying to understand this function. I try to compile an run it, but it gives an error message at line 12. Thanks. #include <iostream> #include <string> #include <cmath> using namespace std; int stringConvertInt(string raw) { int sum=0, power=0; power=raw.length()-1; for(int i=0; i<raw.length(); i++) { sum=sum+(pow(10,power)*(raw[i]-48)); power--; } return sum; … | |
i have a problem that how to concatenate more than two string in operator overloading i write a code but it is not run #include<iostream> #include<conio.h> using namespace std; class count { private: char str[50]; public: count() { str[0]='r'; } void input() { cout<<"Enter string = "; cin.getline(str,50); } count … | |
My program displays the details of 2 students. name id address module code and module marks. my program works well but the problem is when i enter the details of the 2nd student i am not able to enter the name as if it skip this first part and go … | |
Here's a little program i wrote, i'm trying to pass my structure book to function input. The code works fine on Code::Blocks but VS12 is giving an error on compliation " error C4700: uninitialized local variable 's' used ". What i'm doing wrong? #include <string.h> #include <iostream> using namespace std; … | |
The insert function int the arrayList is not working...d[count] = v is giving garbage.I am unable to find the problem.Can anybody please help. class ArrayList { private: int count; int *d; public: ArrayList(int size=2) { d=new int[size]; count = 0; } void insert (int r) { d[count] = r; count++; … | |
This fuction of insert in descending order is not working.Can't find the problem.Can anyone help? class LinkedList { private: class ListNode { public: int data; ListNode *next; ListNode(int d) { data=d; next = NULL; } }; ListNode *head; public: LinkedList() { head=NULL; } void Inorder(int d) { ListNode *tmp = … | |
#include <iostream> #include <conio.h> using namespace std; int main(){ char command[1024]; char newchar; cout << "Command Line Interface Test with Intellisense" << endl; cout << endl; newchar = _getch(); command = command + newchar; } My Code. It doesn't work. `command = command + newchar` has a problem. Please help. | |
please give me a code of multiple linked queue in data structure using c++ | |
I have a text file below that I read from. 0123456789012345678 IN NUMBER LOOP LD NUMBER BZ LPEND LD TOTAL ADD ONE STO TOTAL LD ZERO SUB NUMBER BGTR ENDIF BZ ENDIF LD POSITS ADD ONE STO POSITS ENDIF IN NUMBER B LOOP LPEND LD POSITS MPY HNDRD DIV TOTAL … | |
i am not able to connect to the sql server on my system. SqlConnection^ connection=gcnew SqlConnection(); connection->ConnectionString ="Data Source=blueboy\sqlexpress;Initial Catalog=DCV_DB;Integrated Security=SSPI;Pooling=False"; i got the string from database properties.(i have attached the same in this post) sql service is running. tcp ports are enables too. | |
Please help me with this error. Thank you in advance [Linker error] undefined reference to `Simple_window::Simple_window(Point, int, int, String const&)' | |
Write a complete C++ program that reads the attached file (values.txt) to find and print the following: a. The average value of the numbers in the file. b. The maximum and minimum value c. The count of negative and positive values (ignore zero) #include <iostream> #include<fstream> using namespace std; int … | |
I tried all possible test cases and It outputed the correct answer , I wonder why UVA doesn't accept my answer <#include<iostream> #include <stdio.h> using namespace std; int main() { int i, j; unsigned long long int tempI, tempJ; int maxCaseLen = 1; int count = 1; while (scanf("%d %d", … | |
I am getting an error in the header file: class linkedStackType: public stackADT<Type> Can you see anything wrong with what I have, and why the compiler is complaining about "stackADT"? I would love it if you could give me some insight into this matter. Right now I'm only concerned about … | |
// This program uses the a queue template to create a queue of strings. #include <iomanip> #include <iostream> #include <cstdlib> using namespace std; // // TO CREATE A "template" class named "T" template <class T> // // TO CREATE A CLASS NAMED "Dynque" class Dynque { private: struct QueueNode { … | |
{file has 1000 lines that look like these 114680858 19670607 Matilda Vincent MI 114930037 19471024 Desdemona Hanover ID 115550206 19790110 Xanadu Perlman ND 116520629 19630921 Alexander Hall SD 117050976 19301016 David Lamprey GA 119610646 19650202 Thomas Porlock IL 120330928 19621126 Cary Cartman NC struct employees { int ss_number;//social security int … | |
Hello, I have a bug in my program somewhere and I cannot understand why. The program merely prints data from a binary file. Here is the code: #include <iostream> #include <fstream> #include <vector> #include <cstdint> using namespace std; int main(int argc, char *argv[]) { if (argc!=2) { cout<<"Invalid argument count, … | |
i am trying to overload +operator to concat 2 strings i tried to write a code but it is giving 2 errors and i am also not sure whether logic is correct..MY CODE is [CODE]#include<iostream.h> #include<conio.h> #include<string.h> class string { char *str; public: string() { cout<<"enter string"; cin>>str; } void … | |
I hve sme doubt in pseudo code I hve created da flow chart and c++ code but I need to create pseudo code I dnt no hw to create it Becz da flow chart hve 2 inputs such as cot=0, ans='y' And 5 option such as add inquiry , view … | |
Hello, I have the following problem: Entering coordinates of points on a plain with keyboard (as rows x,y). Analysing this coordinates. Replacing coordinates in vector (point - structure data type). Then calculating distance from the first point to all another points. I've written the code of this problem using arrays … | |
hi so why isnt queue printing anything where it should? #include<iostream> #include<string> using namespace std; template<class ItemType> struct NodeType { ItemType info; NodeType* next; }; template<class ItemType> class Queue { private: int size; NodeType<ItemType>* front; // It points to the front of a singly-linked list NodeType<ItemType>* rear; // It points … | |
I have solved it... Shame... -------------------------------- I have problem with this code: cin >> str; smatch m; regex e("([[:w:]]+)@([[:w:]]+)\.com"); //<- Here was the error (it was regex e("([[:w:]+)@([[:w:]]+)\.com");) silly me :(( bool found = regex_search(str, m, e); cout << "m.size() " << m.size() << endl; for (int n = 0; … | |
Hi, So I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when the … | |
Using the sample BUBBLESORT program with CHARACTERS given in class do the following: Enter 10 words (does not have to be a phrase or sentence..you may use some digits, caps, and special characters like punctuation. Have each of these words including punctuation entered into a character array. Print out the … | |
Hello, I am trying to create a tone, then another tone using this code. It currently only plays one of them. Is there something missing or am i going about this wrong? for(int n = 0; n < num_samples; n++) //where n is the step |start of for loop { … | |
Hello everyone, i am going to create a small tune though i have no idea how to go about it. I currently have a sine wave that plays for one second using a loop similar to this // loop to generate audio samples for(int n = 0; n < num_samples; … |
The End.