Member Avatar

How should i give space between my output numbers while i am storing them in an array ?Like if i ask user to enter numbers and one entered 12345 ,i want to display them as 1 2 3 4 5

+0 forum 0
Member Avatar

New to asking help but I'm desperate. I have most of the code I just need advice and also how to put the value from the file into the array and then pass to the functions without using any strings or string header. Basically trying to make this work and I'm stuck. #include <iostream> #include <iomanip> #include <fstream> //Array Size Set const int ARRAYSIZE = 25; using namespace std; //Declaring Function Prototypes char findComplement(char,char); char findmRNA(char,char); bool isPalindrom(); char displayResults(char,char,char); int main() { //Declaring Arrays with constant size of 25 char dnaArray[ARRAYSIZE]; char comArray[ARRAYSIZE]; char rnaArray[ARRAYSIZE]; int size=0; int i=0; …

+0 forum 0
Member Avatar

Hello everyone. First of all apologies for my english. It is not my native languate and also if i break any good practice. It is my first Post. I'm triying to learn CGI programming in C. Just for learn purposes and i have been triying litle step by step tests. First i did the hello world and it worked, then i made the CGI read a data file in a folder outside the cgi-bin but inside the /var/www. I'm working on an Amazon Ec2 instante with Amazon Linux (i think is some kind of CentOS). I think my Apache is …

+0 forum 0
Member Avatar

I’m stuck at a problem. I want someone to help me with how to proceed further? I’m working on a problem in C++. Its main idea is as follows. I have a buffer(vector in my case) in which each item holds 4 values. 1. start line 2. end line 3. start index 4. end index I’ll receive a line of data. Each line is capable of holding 4096 float values. my program has 4096 such lines spread over 360 degrees. Step 1: I’ll receive 4096 float values. call it as line 1. it can contain a mix of zero and …

+0 forum 0
Member Avatar

Hi. I am attempting to make a GUI program as a personal project in C++ using visual studio. This is what the program does: If you run the program at 2:30pm, the program will check off a box that says "you are in hour two" (because the hour of the day in which you decide to run the program is in the 2th hour). If you run the program at 7:20am, the program will check off a box that says "you are in hour 7" (because the hour of the day in which you decide to run the program is …

+0 forum 0
Member Avatar

hello, I am trying to learn c++, and I am trying to run this program to display the correct answers in the end. the user will be asked to input their answers to the 20 questions on the list. for what I have read, I think I should be using some if or nested if statements? please help, thank you. Also, this is not my assignment (as I was accused of from other forum I tried), I am already working and just trying to learn programming on my spare time. thanks again, code is below. #include <stdio.h> #include <conio.h> #define …

+0 forum 0
Member Avatar

I have a CSV file with a bunch of columns, but I only need the information for the 11th column. How do I read through each line and skip to the 11th column and then store those values in a vector? I'm struggling to find clear information on how to read files in c++. This is what I have so far: #include<iostream> #include<fstream> #include<vector> #include <sstream> #include <string> std::string readStock(std::string fileName){ std::vector<std::string> ticker; //create vector std::ifstream f(fileName, std::ios::in|std::ios:: binary|std::ios::ate); std::string finalString = ""; if(f.is_open()){ std::string str; std::getline(f,str); //skip the first row while(std::getline(f,str)){ //read each line std::istringstream s(str); //stringstream to parse …

+0 forum 0
Member Avatar

I am a student learning, I was tasked with the following; > Create a class called AddressBook. Create the address book with a dynamic array and when the object is created, the programmer should specify the maximum number of items in the addressbook. (e.g.) AddressBook myAddressBook(20); It should contain a method called addName that will take a name and phone number and add it to the address book. There should be a method called findName that will take a string for the name and return the phone number if found in the list otherwise return “Person Not Found”. The class …

+0 forum 0
Member Avatar

Hi, I am getting an error while making a vector. frame.h #include <wx/wx.h> class Frame : public wxPanel { public: Frame(wxPanel* parent, int xx, int yy); ~Frame(); private: int x; int y; } frame.cpp #include "frame.h" Frame::Frame(wxPanel* parent, int xx, int yy) :wxPanel(parent) { x = xx; y = yy; } Frame::~Frame() { } in another wxPanel , I am creating a vector- std::vector<Frame> vFrames; And using it in a function- FinalFrame::addFrame() { vFrames.push_back(Frame(this, 20, 40)); } And I am getting this error- `error: use of deleted function 'Frame::Frame(const Frame&)' ` Is this related to wx or I am coding …

+0 forum 0
Member Avatar

analyze the problem. walkthrough the code. I would like to charge for this solution $10 to Renewal Computer Services, if I may post here (kids & teens free). when -50 is reached, doesn't blow past the maxvalue+1U and cause a cpu-hogging forever loop, it doesn't actually reach -50 equivalent (UINTMAX-49). #include <cstdint> #define ufordown0(var,maxvalue,step) for(uint64_t var=maxvalue; var>maxvalue; var-=step) /* Example: ufordown0(i,200U,50U) { } */

+0 forum 0
Member Avatar

I got an assignment in which I need to create a physics calculator to solve the 'Motion' formulas, this is an screenshot of the formulas I need: [Motion formulas](https://imgur.com/a/sU8SfEk) The problem that I'm having is that I'm literally lost in how to implement them. I have found lots of tutorials but all of them want to solve for everything, I mean all of the letter of each equation and that's not what I want. I currently have this but I feel like I'm complicating my life with a lot of fuctions for something that is supposed to be simple. Right …

+0 forum 0
Member Avatar

Hi. I wanted to review the idea of "Link List" but using C++ and not Java. I borrowed a header file from a textbook to test how a link list works (I know that if I don't paste the whole code [its not my code anyway. It was from a textbook], it would be hard to help me but I don't want to copy the whole code from the text book. I will just show the functions that I am using. If my question still does not make sense, please mention it in the comment section below so that I …

+0 forum 0
Member Avatar

Hi there everybody just needed some help sorting an object array. So the array takes in a title, link, comment, length, and rating of the video. Once the values are put into the array the user inputs whether they want to sort it by title(alphabetically), length of the video (ascending order), and then rating of the video (descending order). The code runs and compiles perfectly fine right now but just dont know how to put in the place the sort functions. ** VIDEO.H** #ifndef VIDEO_H #define VIDEO_H class Video{ public: Video(string t, string l, string c, float time, int a); …

+0 forum 0
Member Avatar

Hello. I have to write a code that models a bank account using "C++". It must complete the following functions: (1) Make a withdrawal and deposit (2) change account owner (3) find balance on account (4) create new account However, I can not write all my code in one file but must use "Object Oriented Programming" to do this (it is more efficient). Unlike java (which I am more familiar with), to do this I must create one ".cpp" file, one .h" file and a test file in "C++". I don't think I have the correct idea when it comes …

+0 forum 0
Member Avatar

I am new at this and not found online.

+0 forum 0
Member Avatar

I have an assignment to create a card game that compares to dealt cards between players to see who has the highest valued card. It must first be determined by the cards value, then only if it is tied, the suits value. The code below is what I have so far. It is working, but it isnt how I need to compare the two cards together. string card(unsigned int card) //Assigns suits to values { if (card >= 52) { return "Invalid"; } return values[card % 13] + " of " + suits[card / 13]; // where card ranges from …

+0 forum 0
Member Avatar

hello everybody who can help with this task Now I will talk little about monoalpahapit cipher This is cipher is based on substitution the characters with another characters So in the encrypt.java file it counts how many the characters appeared in the cipher text , so in the picture that I sent to you it contains the statistics of most frequently characters, an example : suppose in the cipher text the character ( O ) appeared 16 times and it’s the most frequently character so you will back to the picture of the statistics and see what is the most …

+1 forum 0
Member Avatar

Hi i'm Anis. I want to ask how i can attach image from database in FPDF?

+0 forum 0
Member Avatar

In the follwong program a class-type temporary is cast to a refrence and they changed: struct A { int a; A() { a = 100; } }; void f(A& x) { x.a = 200; }; int main() { f((A&)A{}); } No errors in Visual Studio and GCC. But is it safe to use such cast, instead of useing rvalue reference, in Standard C++?

+0 forum 0
Member Avatar

Hi, I've been playing a game from a few years back (I really enjoyed it) and I found that it was open source on github. I would love to make my own version and see how it goes. I have experience with python as a hobby, and I've had a go at c++ - I made a few games with the sdl library. The github link - https://github.com/id-Software/RTCW-SP It will be great if I could at least render a level and a character. From what I see, the source has everything I need apart from the graphics. If someone can …

+0 forum 0
Member Avatar

## Hey, ## I crated a program which can search a text for a string and gives you every line which conatins that string back. Now I want to create another text file with the output. But I cant get it to work. Actually I have no problems with creating the text file becasue its creating it but its always empty. I just dont know how to gte the results from the top of my code into the output text file. Here is my code: #include <string> #include <fstream> #include <iostream> #include <sstream> using namespace std; int main(void) { string …

+0 forum 0
Member Avatar

The program needs to get loan amount, loan term, and loan interest rate from the user and then use those same numbers to create a function that calculates the monthly payment of the loan using monthlyPayment = principal * rate / ( 1.0 – pow(rate + 1, -term)); I've come this far. After I get the amounts from the user, how do I use what they inputed to save in the program so I can use those same answers in the monthlyPayment function for the calculation? Any help is greatly appreciated! #include <iostream> #include <string> #include <cmath> using namespace std; …

+0 forum 0
Member Avatar

So, I have created a text file containing the following: 10001 General Electronics 500 20001 fACEBOOK 700 10002 Twitter 400 The records are stored in a struct containing an integer id, string company and integer number of shares variables. I want the user to enter a Id, say 20001, and the output should display the details of only that particular user and not of anyone else. Also, I want to change number of shares of user 20001 from 700 to 600.

+0 forum 0
Member Avatar

Hi I am trying to get windows positioned in specific order as show below ![desired.PNG](/attachments/large/3/6447240b1491d04046fa904f31659f9b.PNG) but I am unable to get and get always this ![wrong.PNG](/attachments/large/3/71f4b92c4f40a6afeeab7e3c2f136526.PNG) the code below is shown HDWP cmdWnds; cmdWnds = BeginDeferWindowPos(col.size()); for (int i = 0; i < col.size(); i++) { if (i == 0) { if (DeferWindowPos(cmdWnds, col[i], HWND_NOTOPMOST, x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) return ERROR; } else { if (DeferWindowPos(cmdWnds, col[i], col[i - 1], x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) …

+0 forum 0
Member Avatar

# An orders class def __init__(self, order): # Initialise self.ID = order.order_id self.kits = [] kit = {} for x in order.kits: # Add kit kit['Type'] = x.kit_type kit['Objects'] = x.objects self.kits.append(kit)

+0 forum 0
Member Avatar

I am trying to create a header file that contains several global variables. At the moment, the Globals header file looks like this: This is Globals.h #ifndef GLOBALS_INCLUDED #define GLOBALS_INCLUDED #include <string> std::string DRIVE="HELLO!!!!!"; #endif To go along with this, I have a cpp and h file the contain a single function, as follows: This is Bull.h ifndef BULL_H #define BULL_H #include "Globals.h" #include <iostream> int po(int x); #endif and This is Bull.cpp #include "bull.h" int po(int x) { extern std::string DRIVE; std::cout << DRIVE << "\nBULL\n"; DRIVE="BULL\n"; return 1; } Finally, the main execution program, main.cpp: #include <iostream> #include …

+0 forum 0
Member Avatar

((a+b)-(c+d))^2

-1 forum 0
Member Avatar

``

+0 forum 0
Member Avatar

/* #include<iostream> #include <iomanip> using namespace std; int main() { int r=12,i,j,k; cout<<setfill(' ')<<setw(18); for(i=1;i<=r;i++) { j=r-0; if(i==12) { cout<<j; } } for(i=1;i<=r;i++) { j=r-11; k=r-1; if(i==1) { cout<<endl<<endl<<setfill(' ')<<setw(10); cout<<k; } if(i==2) { cout<<setfill(' ')<<setw(15); cout<<j; } } for(i=1;i<=r;i++) { j=r-10; k=r-2; if(i==3) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(6); cout<<k; } if(i==4) { cout<<setfill(' ')<<setw(24); cout<<j; } } for(i=1;i<=r;i++) { j=r-9; k=r-3; if(i==5) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(4); cout<<k<<"."; } if(i==6) { cout<<setfill(' ')<<setw(26); cout<<j; } } for(i=1;i<=r;i++) { j=r-8; k=r-4; if(i==7) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(5); cout<<k; } if(i==8) { cout<<setfill(' ')<<setw(23); cout<<"#"<<j; } } for(i=1;i<=r;i++) { j=r-7; k=r-5; if(i==9) { cout<<endl<<endl<<endl<<setfill(' ')<<setw(9); cout<<k; } …

+0 forum 0
Member Avatar

I already have a save function in my tool as like a normal tools. Now I would like to add auto save function , that has to save all the operation that made in the tool(we called that overlays). I need to write an auotsave function and I have to pass as command line arguments. Could some one will help you out. More detail: When I right to open my tool in Linux, mostly we used to pass like cd home/...../ and ToolName. I need to use the autosave function as command line arguments. for eg: I pass the argument …

+0 forum 0

The End.