49,757 Topics

Member Avatar for
Member Avatar for kshahnazari

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 ?

Member Avatar for deceptikon
0
109
Member Avatar for gfp91

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 …

Member Avatar for mrnutty
0
104
Member Avatar for munchlaxxx

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 …

Member Avatar for Gonbe
0
2K
Member Avatar for strungoutfan78

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 …

Member Avatar for strungoutfan78
0
188
Member Avatar for NewUser22

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 …

Member Avatar for Ancient Dragon
0
296
Member Avatar for daino

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 …

Member Avatar for Ancient Dragon
0
807
Member Avatar for marnun

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 …

Member Avatar for marnun
0
275
Member Avatar for sheikh zohaib

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 …

Member Avatar for sheikh zohaib
0
176
Member Avatar for pilotkid424

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 …

Member Avatar for pilotkid424
0
216
Member Avatar for jlillie

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 …

Member Avatar for vmanes
0
164
Member Avatar for restrictment

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"); }

Member Avatar for mike_2000_17
0
140
Member Avatar for pars99

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.

Member Avatar for deceptikon
0
196
Member Avatar for serita.v.campbell

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) …

Member Avatar for Gonbe
0
206
Member Avatar for haidang.nguyen

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 …

Member Avatar for deceptikon
0
159
Member Avatar for CHOCHOCHO
Member Avatar for hasan101002

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); …

Member Avatar for hasan101002
0
395
Member Avatar for myk45

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 …

Member Avatar for myk45
0
190
Member Avatar for fishsticks1907

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 …

Member Avatar for vmanes
0
224
Member Avatar for DarkVision

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 …

Member Avatar for Ancient Dragon
0
150
Member Avatar for Jbvo

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. // …

Member Avatar for Jbvo
0
91
Member Avatar for izabella.pearson

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 …

Member Avatar for phorce
0
199
Member Avatar for marnun

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 …

Member Avatar for marnun
0
237
Member Avatar for dr_iton

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 …

Member Avatar for dr_iton
1
2K
Member Avatar for motrcolt

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 …

Member Avatar for Ancient Dragon
0
917
Member Avatar for milan2011

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() …

Member Avatar for jrobertomar
0
2K
Member Avatar for thinkaboutyoueveryday

`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 …

Member Avatar for NP-complete
0
199
Member Avatar for ShEeRMiLiTaNt

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 …

Member Avatar for Agni
0
149
Member Avatar for smart.saravana.1

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 …

Member Avatar for smart.saravana.1
-1
151
Member Avatar for thinkaboutyoueveryday

# 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. …

Member Avatar for thinkaboutyoueveryday
0
224
Member Avatar for thinkaboutyoueveryday

# 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 …

Member Avatar for thinkaboutyoueveryday
0
292

The End.