49,757 Topics

Member Avatar for
Member Avatar for Carpetfizz

Hello, I learned a lot of basic C++ programming through Code Blocks and I think it is a fantastic IDE. I decided to switch to VS2010 Professional for various reasons, and because I am able to get it free from Dreamspark. I had created another post a while back similar …

Member Avatar for Suzie999
0
166
Member Avatar for Salman93

program in which we calculate total marks in a course and print a course grade by using if-else conditions. However check, if user enters correct marks or not, for example midterm marks is between 0 to 20. If user enters midterm marks less than 0 or greater than 20 then …

Member Avatar for WaltP
-2
130
Member Avatar for riccardo-m

Hi, I've been trying to send a long integer from an Arduino to my C++ program via the serial port. There seems to be many examples of this when i search, but I've not had much luck except for one example. This example seems to work, but not when I …

Member Avatar for riccardo-m
0
3K
Member Avatar for rtyui

Hi. I am trying to assign the value returned by asctime(struct tm \*) to a string. But when the program is run, I got segmentation fault. GDB shows: Program received signal SIGSEGV, Segmentation fault. 0x0000003e6d6aa192 in __offtime () from /lib64/libc.so.6 What could be the reason? Can't we assign the value …

Member Avatar for deceptikon
0
375
Member Avatar for pattilupwned

Hello, I am having trouble passing a file into parallel arrays. Based on the code below, I get a bunch of jumbled numbers on my cout screen that don't even show up in the input file. I have attached a PNG of the console output. I am at a loss …

Member Avatar for Suzie999
0
436
Member Avatar for maple23

I am trying to learn multi-dimensional arrays in C/C++, but am not having much luck. I think I understand the way this type of array works, but I am having problems. [code]#include <stdio.h> #include <stdlib.h> #define MAX_NAME_COUNT 10 #define MAX_NAME_LEN 100 int main(){ char *names[MAX_NAME_COUNT][MAX_NAME_LEN]; int x; printf("enter the names …

Member Avatar for richard_arnold
0
766
Member Avatar for agachhayat

//This programm is for testing function overloading #include <string> #include <fstream> #include <iostream> using namespace std; class Text { string str; public: Text (); Text (string); string contents (); }; Text::Text (string st) { ifstream in (st); getline (in, str); } string Text::contents () { string ret; ret=str; return ret; …

Member Avatar for np complete
0
81
Member Avatar for melissa.kapolka

void getScores(float **scores, int num) Can someone help me understand what this means? Especially the **scores.... I know what a float is and that it is to get scores inputed in by the user. Thanks

Member Avatar for melissa.kapolka
0
94
Member Avatar for andigirlsc

I am having trouble getting MS Visual C++ to recognize my input for the 2nd getline I have listed. It already recognizes getline(cin, firstName) and allows for input, but won't recognize the second instance of getline. When the program gets to that line of output, it bunches the next two …

Member Avatar for deceptikon
0
384
Member Avatar for ChilledGrease

I started coding C++ this past week, and yesterday I challenged myself to write something original that my book doesn't have hints on. It is a program that prompts the user to think of a number between 1 and 100, and proceeds to guess the user's number. The user tells …

Member Avatar for Suzie999
0
280
Member Avatar for nitishok

I have written a program for the 8-Queens problem.It prints all possible solutions. queens() finds all the possible solutions. ok() tells whether the given column and row is safe or not. The very strange problem is: 'Count' won't increment. I have no idea why. #include<iostream.h> #include<stdlib.h> #include<conio.h> int arr[8][8]={0}; int …

Member Avatar for deceptikon
0
167
Member Avatar for nikhil.pro
Member Avatar for Ancient Dragon
0
104
Member Avatar for riccardo-m

Hi, I'm making a program using Visual Studio 2010. I'm strugging with how to correctly use classes and their instances. For example; What is the difference between using the following ways to call function from one class within another... Example 1: Dialog.h #include OtherClass.h MyOtherClass myClass; Dialog.cpp myClass.MyFunction(); Example 2: …

Member Avatar for riccardo-m
0
253
Member Avatar for Tinnin

Hi all. I'm working my way through "Accelerated C++" have a question regarding chapter 5. The program calculates students final grades by taking a median of the homework grades. I am trying to alter this program so that it uses *list* instead of *vector*. The issue I'm having is with …

Member Avatar for Tinnin
0
171
Member Avatar for dhruv_arora

My school and the education board uses Turbo C++ as the compiler. I have Windows 7 64 bit. Can anyone tell me how can I install Turbo C++ on my computer.

Member Avatar for harsh01ajmera
0
449
Member Avatar for 03Mach1

So I am trying to write a program that will tell you the lowest grade and the highest grade out of the 3 wthat you put in and also tell you the current average you have in the class. I got the lowest and highest part taken care of but …

Member Avatar for np complete
0
262
Member Avatar for linc186

I've been trying to get this to build for hours, I have no idea what's wrong. Any help is appreciated, thank you. Here's the code: main.cpp #include "SDL/SDL.h" #include "Core.h" #include "GameStates.h" #include "globals.h" int main(int argc, char** args) { if(core.Initilization(640, 480, 32, SDL_SWSURFACE) == -1) { SDL_Quit(); } while(core.desiredstate …

Member Avatar for gusano79
0
281
Member Avatar for limzhengtong

**this is my displacement.h** #ifndef DISPLACEMENT_H #define DISPLACEMENT_H class displacement { public: displacement(double, double, double); double getvalue(); private: double s,t,a,v ; } #endif **this is my displacement.cpp** #include "displacement.h" ;using namespace std; displacement::displacement(double t1,double a1,double v1) { t=t1; a=a1; v=v1; s = v * t -(0.5) * a * t …

Member Avatar for zvjezdan.veselinovic
0
406
Member Avatar for slasham

im very new to c++ and was just wondering if its possible to make a simple program where you type the name of the file and when you press enter it downloads that file from the internet to a certain place on your computer. where would the files be stored? …

Member Avatar for np complete
0
834
Member Avatar for muhammads

Hi All, I am new to C++ on linux enviroment and am trying to use the png++ library for a project. The problem i am facing is that that a simple program i write using png++ incudes does not work and shows me the following errors > AProg.o: In function …

Member Avatar for np complete
0
276
Member Avatar for myk45

Hello All! To check for return values from a function and setting error flags, i am currently using the following approach: bool fine = true; fine &= func1(); fine &= func2(); .. and so on. if (!fine) { // error } Could anyone please let me know if there is …

Member Avatar for myk45
0
203
Member Avatar for montjoile

Hi! I want to execute a method without pressing the enter key, what I want to do is get the press key an save it in an array while the user is typing, but I dont know how to execute an event without pressing the enter key here is my …

Member Avatar for montjoile
0
454
Member Avatar for sajis997

Hello forum, I believe that i have the design problem that i need to discuss about. Intersectable is the super-class; Triangle and Sphere are the sub-classes of the Intersectable i believe that you already realized class inheritance structure. I have the following pure virtual functions declared inside the INTERSECTABLE virtual …

Member Avatar for sajis997
0
107
Member Avatar for np complete

There are N horses in the stable. The skill of the horse i is represented by an integer S[i]. The Chef needs to pick 2 horses for the race such that the difference in their skills is minimum. This way, he would be able to host a very interesting race. …

Member Avatar for np complete
1
1K
Member Avatar for shmay

I'm trying to read from a text file. Pretty simple, right? I guess not. It gives me this error message: Debug Assertion Failed! Program: F:\Debug\lab1431.exe File: fscanf.c Expression: stream != NULL For information on how your program can cause assertion failure, see the Visual C++ documentation on asserts. [code] #include …

Member Avatar for randomjokar
0
697
Member Avatar for superchica08

hello everyone I really need help so I have to make functions that find vowels, digits and uppercase and lowercase letters from a sentence inputted. So i was able to do it all in main but i cant seem to make the new program work with the functions properly, it …

Member Avatar for superchica08
0
298
Member Avatar for olusegun.oluwadamilola

Write a program: A company requires a human resource application to manage the data base of the company’s personnel. The system to be designed must be able to register workers and their details: name, date of birth, marital status, race, sex, cell number and ID number.

Member Avatar for np complete
-3
61
Member Avatar for zeppelyn

So, I'm merely just a student learning and all that. The assignment has four components: write a bubble sort function with test program, write a quick sort function with a test program, write a shell sort function with a test program, then finally write a main program. For each compare …

Member Avatar for WaltP
0
195
Member Avatar for ryan.wood.1042032

I was coding up a class template a little while ago and I came across an error while debugging: error: invalid conversion from âstd::basic_string<char>*â to âcharâ [-fpermissive] It was in the code template <typename T> void ArrayList<T>::insert(const T& x, unsigned int i) { if (i >= m_max) cout << endl …

Member Avatar for NathanOliver
0
160
Member Avatar for MasterHacker110

Ok what I mean is if i build say a client and server side (network) program in c++ on linux. Will i be able to run it on windows? i know that linux creates .o files and those are executed. were windows create .exe files and thos are executed. I …

Member Avatar for deceptikon
0
179

The End.