49,761 Topics
| |
Hi. I was trying to figure out how to read and write files in C++. To understand it better I wrote this code on "codepile.com": https://www.codepile.net/pile/WDPkzrep. What it does is it allows a user to create their own text file then write information in it. Lastly, the contents of the … | |
// MajorProJectMB.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include<cstring> #include<fstream> #include<iostream> #include<string> #include <iomanip> #include <cstdlib> #include <string> using std::ifstream; using std::ofstream; using std::ios; using namespace std; struct project { char comma[10]; double NumFields[10]; string lastfieldName; string firstfieldName; double Toltal = 0; … | |
int hashKey(int key) { return key % tableSize; } void insertar(int key) { int index = hashKey(key); while (hashTable[index] != NULL) { hashTable[index] = key; index++; } } i'm trying to add values to this hash table array, but i"m having trouble trying to make it. I already initialized the … | |
Hi. I wanted to create a GUI application with C++ as a personal project. I am using that because I have done a lot of GUI personal projects in Java but never in C++, so I want to try using a new coding language I learned. I don't know a … | |
New to this site I would like to say hello. My main interest is programming in cpp and especially the use of the Standard Template Library and std:: stuff. More than willing to look into any questions from the community. Perry. | |
Hi, I am a newbie here, Recently I was working with H3LIS331DL 3-Axis Linear Accelerometer I²C Mini Module Here is code for the X, Y, Z-axis. #include <Wire.h> // H3LIS331DL I2C address is 0x18(24) #define Addr 0x18 void setup() { // Initialise I2C communication as MASTER Wire.begin(); // Initialise Serial … | |
Hello everyone, I am writing this post again because there were ambiguities in the previous one. I need help with this task tomorrow. I will present what I have, what I got from you and ask which code is best to use to perform this task. I will start with … | |
i am new to c++ and m having a problem in making a scientific calculator plsss help me i dun know how to make the power function work here is my program m working in visual studio 2005 ,c++ getiing this error error C2064: term does not evaluate to a … | |
I am new to C and C++, but I wrote this calculator in C++. It compiles okay on borland 5.5, and can do addition, subtraction, multiplication, and division of two numbers. If you type any characters except numbers, +,-,*,/,or e, there will be lots of beeping noises and error messages! … | |
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 … | |
hai everyone im supposed to create a futsal reservation system which has 3 courts customer name should be shown in the booking table till now the customer name is printing on the table ...but i dont know how to save the name | |
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 … | |
How to read .CFG file in c#, and make in object so we can modify using that object. | |
| I've recently started learning C and I have a simple program that I can't get to work. (I'm pretty sure C++ and C are similar enough at the basic level not to cause any problems in this forum). I've tried it by substituting the scanf("%s", myName) captured string data with … |
Output: Enter Element Name: Hydrogen Hydrogen is a non-metal | |
Hey guys! I got super behind in my C++ class and I feel like I dont really know what I am doing. I've been trying to piece together from other examples of password coding, but I got a little lost in the sauce. Anyways, the requirements for this program is … | |
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 … | |
Hello, I am trying to understand how to use C-style strings in C++. My goal is to store a C-style strings into a string type array. If I pass "This is a test" into word_token, it displays: This Is A test So from here I believe my setup is almost … | |
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; … | |
Here is the input file. 12345 67890 I want 123 in array1. I want 678 in array2. int array1[10], array2[10]; int n, i=0; ifstream x; x.open("input.txt", ios::in) while( (!x.eof()) || (i<3) ) { x >> n; array1[i] = n; i++; } //here should be the command for next line i … | |
I'm still stuck on this one question, can someone help me with this? 4.) Write a program that asks the user to type positive integers. When the user types a negative value the program writes ERROR and asks for another value. When the user types -1 that means that the … | |
Thank you in advance for anyone who is willing to help me. Can someone give me the answers and briefly explain what you did? I have been stuck and frustrated with these questions for about a week now, so I'm asking for help. There are two questions that I need … | |
new to programming. everytime i try ti comppile this program i get an error message saying expected unqualified... here is the code and the question that the code was made from Write a program that uses a loop to print the numbers from 10 to 20. int main(); int crt … | |
im new to programming. every time I try to compile my programs I get the message saying "expected unqualified id before '{' token. heres an example: int main() #include <stdio.h> int a, b; printf("Enter the first value:"); scanf("%d", &a); printf("Enter the second value:"); scanf("%d", &b); a = b + (a++) … | |
Hello, I am stuck on how to exactly do this problem if anyone could offer me any help with either a worked out solution or just some pseudocode that would be great. Here are the rules and information about the assignment below. Assignment: What is The Game of life? Not … | |
Write a Program that asks the user to input a positive integer. If the user inputs a negative number, program should output "ERROR" and ask for /the user's input again. If the user inputs the value of 0, the program says "NO AVERAGE". If the user inputs a -1, the … | |
Hello, I am stuck on where to go with this assignment for checking if the sliding puzzle is solved right or wrong. I will include the context of the assignment so you can see what needs to be included. If you could just share some code or pseudocode to get … | |
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<stdio.h> #include <iostream> #include<stdlib.h> using namespace std; int main() string custname,carmodel,carnum; int days=0,rentalfee=0; cout << "Sila isi nama anda : "; cin >> custname; cout<<endl; do{ cout<< "Sila berikan pilihan model kereta pilihan anda !"<<endl; cout<<"Tekan A untuk model Axia."<<endl; cout<<"Tekan B untuk model Saga."<<endl; cout<<"Tekan C untuk model Exora."<<endl; … |
The End.