49,761 Topics

Member Avatar for
Member Avatar for ConfusedLearner

I created a program that will find the biggest number when give 3 different numbers. But when I want to change the program to find the biggest number when you enter 4 integer number I continue to run into problems. I can get it to find the biggest number when …

Member Avatar for Ancient Dragon
0
131
Member Avatar for Labdabeta

Hello, I was partaking in the global game jam (where you have to try to make a game in 48 hours). I got my game pseudo-finished, but I cannot get it to render the scene properly. Here is the code related to the rendering: Code for opengl initialization: glClearColor(0.5f,0.5f,0.5f,1.0f); float …

Member Avatar for Ketsuekiame
0
266
Member Avatar for BobFX

Hi, The Windows API function to select a directory is really bad, so I'm trying to use GetOpenFileName() instead. For that, the idea is to set a hook function, so that when the user hits the OK button without having actually selected a file, the hook function retrieves the currently …

Member Avatar for BobFX
0
3K
Member Avatar for suren3

How to store the elements and display?? struct A{ int level; char name[20]; struct b *a_b; }*d[3]; struct b { char name[20]; struct b *next; };

Member Avatar for akashgupta1990
0
153
Member Avatar for VictorK19

Here's the assignment requirement: > Write a program that creates a series of one or more loan amortization schedules. The program should query the user for an input file name and an output file name. The input file will contain the number of schedules that need to be generated as …

Member Avatar for bguild
0
271
Member Avatar for lewashby

In the following program how or the two while statements working, `while(szTarget[targetIndex])` & `while(szTarget[targetIndex])` since the their first element is initialized to zero? Zero is false and one is true so how are they getting even one iteration? The book I'M reading also made a point of saying this: "It …

Member Avatar for vmanes
0
74
Member Avatar for trantran

I have been programming in Windows with C++ and I am tiptoeing linux (mainly because of its most up-to-date C++ and also because of it's open source). I want to do multi-platform programming. The programming part is easy: I don't need help there. The part I need help is in …

Member Avatar for trantran
1
299
Member Avatar for dreday92

So for my assignment I have to create the Vector class and apply it .hpp to include the "Vector.h" file and no include the original Vector class. I have a few of the member functions done but am not sure how to begin with the other ones and im wondering …

Member Avatar for dreday92
0
516
Member Avatar for lewashby

How can I grow the size of a char array? `char myArray[6];` Assumming that all the current elements are occupied how can I add more empty element to the array to input another value into?

Member Avatar for 9tontruck
0
153
Member Avatar for FearlessHornet

I'm currently making a DLL with a collection of code snippets that I find myself commonly using. I have made a search functin that checks if one string is inside of another string. I have also added a vector choice in the case that I want to search many strings. …

Member Avatar for mrnutty
0
226
Member Avatar for Hey90

I have created a basic object oriented database of a list of shoes containing the shoe name, number and shoe size. I am trying to sort the list of shoes alphabetially by name and by shoe size. I have the following code: Shoes.h: #include <iostream> #include <fstream> #include <string> #ifndef …

Member Avatar for Hey90
0
4K
Member Avatar for bramprakash1989

i tried the following coding .it compiled without errors but gave absurd results during runtime. can u pls help me with it? [code=cplusplus] #include<iostream.h> #include<stdlib.h> int main() { int i; cout<<"ten random numbers for the range 0 to 50"<<endl; for(i=0;i<10;i++) { cout<<rand()<<endl; return 0; } }[/code]

Member Avatar for dramatic
0
1K
Member Avatar for can-mohan

Hi, Below code snippet belongs to copy constructor implementation. my question is in both cases (without and with copy constructor) if i execute this programme ,it will print the diff-2 memory addresses for both objects. 0x22ff20integer=0 (for object s1) 0x22ff10integer=0 (for object s2) but i believe in case of without …

Member Avatar for deceptikon
0
189
Member Avatar for can-mohan

While executing below code, i found it is not functional due to segmentation fault error,even though memry allocation has been done propery in below code but still not sure why this error is coming. i will appreciat e if somebody help me as just month before i started learning c++. …

Member Avatar for remunance
0
437
Member Avatar for lewashby

I'M reading "C++ FOR DUMMIES" 4th edition by Stephen Randy Davis and the chapter on arrays as just introduced this line -> `cout.width(3);` with absolutly no explanation to waht width is. I would like any of you guys to help me wout here but in addition to telling what .width …

Member Avatar for lewashby
0
239
Member Avatar for stephgoesshazoo

So, I'm suppose to make a program following these guidelines. 1. Count all words in the file. A word is any sequence of characters delimited by whitespace, whether or not it is an actual English word 2. Cout all syllables in each word. To make this simple, use the following …

Member Avatar for deceptikon
0
422
Member Avatar for dmd12b

my complier is throwing an error up when i run it. the problem is run into is my Increment function is etither given a number to increment by, or if it is left blanlk (Increment()) should default to incrementing 1. i thought i could do just 2 functions, one with …

Member Avatar for Moschops
0
954
Member Avatar for kshahnazari

I have a simple question about this code struct a { char key; a *next; }; a = here*; and in the function I check if here is NULL or not if (here->key==NULL) ... and Im sure here is pointing to an a(struct) but it gives access violation . what …

Member Avatar for deceptikon
0
138
Member Avatar for phfilly

Hi all! I just have a quick question about the execution of a copy constructor. This is the code i'm testing my work with as I'm busy learning for a test. Class file: Clock :: Clock (int h, int m, int s) { hr = h; min = m; sec …

Member Avatar for can-mohan
0
293
Member Avatar for can-mohan

Hi, while executing below programme on my Dev-c++ 4.9.9.2 compiler , i was bit amazed as it should have not run properly due to use of deleted object (obj). can anybody let me know instead of crashing , it is getting executed without any memory issue. ~Mohan #include<iostream.h> #include<conio.h> //virtual …

Member Avatar for can-mohan
0
132
Member Avatar for raul8

Hi, I've not worked in C, C++ from like 5-6 years. But now I got to do a very small change (explained below). I tried reading tutorials but only got confused. Below I've struct containing 2 attributes. I need to create its refrence and pass values to these 2 attributtes. …

Member Avatar for rajenpandit
0
240
Member Avatar for swiss21

IM BEGGING YOU TO PLEASE HELP ME,IM NOT REALLY FAMILIAR IN PROGRAMMING BUT I NEED TO DO THIS BECAUSE IT'S OUR DEFENSE NEXT WEEK AND I NEED TO CREATE A PROGRAM IN DEVC++ THAT WILL GET THE EMPLOYEE SALARY AND DATA,I KNOW SOME OFYOU GUYS CAN HELP ME CREATE A …

Member Avatar for NathanOliver
-3
206
Member Avatar for silvercats

I can't find the error. Logical error. Total and tax comes as 0. After logging in,enter a desired item number. press 0. then total comes as 0. #include <iostream> #include <conio.h> #include <string> #include <cstdlib> using namespace std; void mainfunc (); void Exit(); struct menuItemType {int itemno;double price;string menuItem;}; void …

Member Avatar for silvercats
0
171
Member Avatar for johnnydiamond08

Hello, I keep getting errors saying "Invalid conversion from pointer to integer and I have tried both of the following operators * after the variable as well as & and nothing seems to work. All input is greatly appreciated. Thank you all for your time. void Stack::print( ) { StackPtr …

Member Avatar for Moschops
0
325
Member Avatar for Teefy

I want to perform Gaussian Elimination on a matrix which is read in as a text file. The format of the text file is as follows: 3 1 3 2 5 0 2 4 4 3 0 9 1 where the first line is the dimension n of the matrix, …

Member Avatar for phorce
0
410
Member Avatar for greatman05

First off, this is a homework assignment. I am in a Software Engineering class and we're learning how to work with MFC. We're editing a basic calculator app. I don't know how to implement the backspace button (delete a single character from the edit box when the Backspace button is …

Member Avatar for Ancient Dragon
0
321
Member Avatar for Ancient Dragon

I know how to create a function with variable argument list, but how do you create one when the argument type is unknown, something like MyPrintf(...) ? From what I've read CLR/C++ only supports known argument types, such as int, `MyPrintf("...array<Int32>^ arr)` and the calling function int main() { MyPrintf("One", …

Member Avatar for triumphost
1
683
Member Avatar for kenney.d.lewis

this code compiles, but when i run the program, it outputs "floating point exception". to my knowledge this happens when you divide by 0, but ive worked it out on paper, and i am not dividing by 0. its the method implementation for a class. if you need it i …

Member Avatar for Moschops
0
255
Member Avatar for akasya

Hello Community, i have a text file... with example following content: Pizza 23232 Car 44,495 Drink 3493,90494 .... .. . and so on.. no i want to find the 44,495 in this textfile.. calculate a new value like 44,495 x 2 + 5 and write the same file as Pizza …

Member Avatar for Bumpehh
0
81
Member Avatar for phorce

Hello, I have a question. I'm not sure I am using the right terms or anything here, but, I have seen people develop their "projects" (classes etc..) and then creating a .dll file (or .lib) and then importing the files when they need them. But I cannot seem to get …

Member Avatar for phorce
0
330

The End.