49,757 Topics
| |
have a simple question about working with files . when Im reading a txt file like this example Hello how are you. fine thank you. when I read it how can I find out there was an endline or not ? | |
hi all. i am a student and i have been lucky enough to try out the havok engin which can use c++. as it is the engin i am using i cant use openGL otherwise ide not have this problem i want to give an object in 3d space a … | |
After you enter a name, it just prints out "Would you like to convert another name? (y/n) " it doesn't even give the user a chance to enter anything and it doesn't print out the converted name. It just ends...Why? #include<iostream> #include<string> using namespace std; void conversion(char name[]); void lowercase(char … | |
Hi all. I've taken a long break from my C++ studies but I'm now being shoved into finding an internship for school so I figured I'd play around and brush up on my coding. I've written this simple tabata countdown timer and I would like opinions on how it could … | |
Hello, I'm just having a heck of a time trying to figure our the answer(s) to the following questions: 1. Declare a struct type, Time, that represents an amount of time consisting of minutes and seconds. 2. Write statements that assign the time 6 minutes and 54 seconds to a … | |
Heyall. I'm trying to use the sqlite3_exec function and am having trouble with the callback feature. I've placed my code below. I realise the callback function provides and argument void *data and the sqlite3_exec function provides a const char *data variable. That is where I'm getting the error. I've searched … | |
It seems I don't understand completely reading from and into files, line by line. Here is my code that is supposed to read lines of two file, into string variables, I assume, and then write them into third file: *line of first file line of second file .... so on … | |
hey all i am new to all this languages and Computer sciences so if you help me i am trying to write a code and its constantly giving me errors here is the code at line 10 , 102 , 115 tell me how to fix it.. waiting... #include<iostream.h> void … | |
I am trying to create a function which adds an array to another array and replaces the data in the 1st array with the new data. For example, A=A+B. However, when I write my code as below, I get the error C2676:binary '[' : 'const Matrix' does not define this … | |
Hi Guys, I'm stressing out over this project. The majority is done. I keep getting an buffer errors. I'm stuck and can't figure it out. I did call stack and it took me to the last parenthesis in main. The closing parenthesis. Also I can't figure out why my card … | |
I keep getting errors and I don't know why.. #include <iostream> using namespace std; class IceCream{ private: int flavor[3]={0,0,0}, topping[3]={1,2,3}, scoops[3]={4,5,6}; public: int getFlavor(int); int getTopping(int); int getScoops(int); void setFlavor(int); void setTopping(int); void setScoops(int); }flavorX, toppingX, scoopsX; int IceCream::getFlavor(int choice){return flavor[choice];}; int main() { cout << flavorX.getFlavor(1); system("PAUSE"); } | |
Is it possible to have a piece of C++ code display a picture and how? I want to display something for my Uncle's employees at a conference were holding with them and I don't know how to display pictures, if there is a way. | |
ok i dont quite know why i keep getting these error in my program.. here is the program: #include<stdlib.h> #include<stdio.h> #include<math.h> Void open(void); int read(float*); float average(float*); void write(float*,float); void close(void); FILE *fptrin,*fptrout; main() { float number[10],non,ave; open(); read(number); non=read(number); ave=average(number,non); write(number,ave,non); close(); return(0); } void open(void) { fptrin=fopen("avg.dat""r"); if(fptrin==0) … | |
So I was given the assignment that asks user to enter file name, then the program will read all integers from the file (unknown number of integers) to an array, and display highest, lowest number, average and number of integers read. The only problem that I have with this is … | |
For example if my string is "^^^^^^Big^^^Bob", i want to turn it in to "Big^Bob" | |
why the code is not running? #include<iostream> #include<string.h> using namespace std; class person { char name[20]; float age; public: person(char *s,float a) { strcpy(name,s); age=a; } person & person::greater(person &x) { if(x.age>=age) return x; else return *this; } void display(void) { cout<<"Name:"<<name<<"\n"<<"Age:"<<age<<"\n"; } int main() { person P1("John",37.50),P2("Ahmed",29.0),P3("Hebber",40.25); person P('\0',o); … | |
Hello All, i am trying to tidy-up some code and i'm not completely sure how this can be done. What i have is this: (This is some sort of psuedocode that i just wrote to explain the problem, not proper code) void foo1(typeofList1 list1) { for (i = 0; i … | |
Im trying to read in data using both getline and cin from a file. But, it only reads in the first line and it leaves everything else empty and/or gives garbage values. output: John Brown grades: 73 57 94 grades: 0 32767 1252009800 grades: 0 0 1263344400 /* data.txt John … | |
here my code now my problem i wonder if you can do something to access specific method from each object example i want to access from Dalek class his method but i cant do this "alien[i]->" will only access method from class ExtraTerrestre any help will be appreciate sorry for … | |
| I am having a hard time figuring out polymorphism with vectors. I keep getting random numbers which I'm guessing is the memory location. If that is the case what am I doing wrong with pointers. And here is part of my .cpp file. Thanks in advance for your help. // … |
You are to write a program that will do the following: Part 1 (30 pts) Grade a 30 multiple-choice question exam and print each student’s name followed by the score (number of correct answers), the appropriate calculated percentage score (number of correct answers divided by 30), and letter grade for … | |
We started learning Heap property in class. Here is an exercise on the topic: > isHeap > Write the definition of a function named isHeap that receives three arguments as follows: > x : an array of ints > i : a valid index into the array x > n … | |
I'm a student and I have to make a program with Console application to manage a Bank Account, using Classes. The program must be able to: - Create e new bank account - Deactivate a bank account - Draw money from account - show the account balance I tried to … | |
Im not really sure if you guys do graphics.h questions here but here it goes. Im trying to find out how to get text to scroll similar to credits at the end of a movie from top to bottom but to have it repeat. I cant find online anywhere that … | |
Hi, i am trying to make a dictionary which takes an english word and its meaning in spanish in the following format from an input file. <english>:<spanish> i also need to add words manually,remove,search,print ,and store new tree in the same file by updating the file. my up() and load() … | |
`Inline Code Example Here`**I REVISED MY PROGRAM** #include <iostream> #include <cmath> using namespace std; int main () { const int num=100; float volt[num], sum=0, sum2=0 ; double ave2,standrddev1, standrddev2, standrddev; float average; int i, k=0 ; { cout<<"Enter the number of voltages to be analyzed:"; cin>>k; if (k>100) { cout<<"Maximum … | |
Hello, I am tryinng to write a program that uses the cin.getline() function to get a users input, but I only need the numbers from this. The problem I am having is when I enter a number then other character it will count the characters after the numbers as numbers … | |
Hi frnds..im Saravanan..im studyng my BE in Govt.college of technology,coimbatore...in our college around 84 companies are coming for computer science students...lik microsoft,comvault,etc...bt i hav second thoughts!!...i want to achieve somthing great...we should prove that we are more worth in this world than modifying an old softwares...we hav to invent somthing … | |
# we are assigned to develop a c++ program that accepts a list of a maximum of 100 voltages as input, determine both the average and standard deviation of the input voltages, and then displays the results. There are still errors and it says it requires array or pointer type. … | |
# Develop a c++ program that accepts a list of a maximum of 100 voltages as input, determines both the average and standard deviation of the input voltages and then displays the results. # ## step 1 : requirements : an average, standard deviation step 2: develop solution: the input … |
The End.