49,755 Topics

Member Avatar for
Member Avatar for needhelp919

An office furniture company sells furniture in three colors: red, black and green. Every item in their inventory system has a 5-character code. The last two characters are always used to represent color. If an item is red, the last two characters are “41”. If an item is black, the …

Member Avatar for WaltP
0
131
Member Avatar for FraidaL

This code is just a function in a bigger code, but I'm having a problem with the break. I'm not sure I'm doing it right, but basically if the factors are zero, then the program should say the equation can't be factored. It does that, but then continues through the …

Member Avatar for zeroliken
0
109
Member Avatar for phorce

Hello, I'm trying to determine where a small matrix would fit inside a big matrix.. But, the small matrix is not in the big matrix so I need to see how simular they are.. The one with the lowest value, is the best fit.. So my difference function is this: …

Member Avatar for Lerner
0
158
Member Avatar for hay123

I am fairly new at C++ and Im having a lot of trouble understanding how to do it. This is part of a homework assignment due next week and I have no idea how to even start it (much less finish coding it). Can anyone out there help? ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Create …

Member Avatar for rubberman
0
146
Member Avatar for phorce

This may sound really noobish, and I'm probably missing something really stupid.. But, I'm trying to calculate the differences between matrices, and the one with the smallest value (result) is the matching number.. But, for some reason my algorithm seems to be missing the smallest number and I can't figure …

Member Avatar for rubberman
0
114
Member Avatar for dark_sider_1

This is probably a really simple and stupid question, but when I try to "Build and Run" an OpenGL program on XCode, it seems to debug it and open the window for a split second and then close. There aren't any compilation errors and it finishes saying that the debugging …

Member Avatar for gusano79
0
256
Member Avatar for TotalZombie

So, I'm playing around with SDL and I've come across a bit of a bump. I have one image and I am trying to "free" that image to put on another one. Here is what my code looks like.. [CODE] // I did get a good section of this code …

Member Avatar for rfrapp
0
213
Member Avatar for rfrapp

Hello, I'm creating a game using SDL, and what I'd like to happen is: if the character jumps on a button, then it'll disappear. However, I cannot find a way of accomplishing this, as all the SDL functions I know of start at runtime and cannot be changed. If I'm …

-1
104
Member Avatar for dctb13

Hi, I'm trying to sort a list of names in c++ (first name and last name). I'm running into a couple of problems with my code. I'll post the code first then state my problems. #include <iostream> #include <stdio.h> #include <cstring> using namespace std; const int numNames=3;//this makes the code …

Member Avatar for BobS0327
0
7K
Member Avatar for vidit_X

I am implementing RSA in C++ and here's my design(code structure). *keygen.h* namespace rsa{ class keygen{ public: //Constructor keygen(size); //Generate keys void generate(); //Getters string gete(){ return xyz; } .. .. .. private: //initializes bignums void initall(); keygen(){} //Private Member variables goes here } } *prime.h* namespace rsa{ //First 100 …

0
95
Member Avatar for hussain shabbir

somebody pleae post some basic C++ excersices of loops.please help me i am a beginner. thANKSS

Member Avatar for thines01
0
80
Member Avatar for gfp91

Hi i need help with moving a light. at the start of the program i define the floats. `GLfloat Light_Ambient[] = {0.7f, 0.7f, 0.7f, 255.0f};` `GLfloat Light_Diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};` `GLfloat Light_Position[]= {0.0f, 1.0f, 3.5f, 1.0f};` but later on in the program while the scene is running i …

Member Avatar for mitrmkar
0
181
Member Avatar for bgx90

I have not found anything that addresses these questions. Any help is appreciated. If I have a class that has pointers to objects of a user-defined class as members, is there any problem with initializing those pointers with the initialization list of the constructor? For example, where A, B, and …

Member Avatar for bgx90
0
3K
Member Avatar for ccbuilder

Can anyone show or explain how to do a base conversions ? I'm new so this concept is confusing so far i got to but I have no clue to get answer from base 10 to any base 2 to base 16 #include <cstdlib> #include <iostream> #include <string> using namespace …

Member Avatar for ccbuilder
0
222
Member Avatar for NerdPC

I have googled this and I see how to do the clock function with insertion and I was pretty sure I implemented it right but the insertion sort never shows any time. I am not sure if I am not waiting long enough but I have had the program up …

Member Avatar for rubberman
0
220
Member Avatar for oscargrower11

I'm sure I'm missing something basic here, but I cannot get this to compile. Using codeblocks 10.05 with mingw build of gcc 4.4.1. I've included unistd.h and tried replacing MAXPATHLEN with PATH_MAX but every time, it gives me: error: 'MAXPATHLEN' was not declared in this scope or error: 'PATH_MAX' was …

Member Avatar for oscargrower11
0
988
Member Avatar for gerard4143

I have a question about istream iterators and reading the input to the EOL. How do you do it? I tried the following but had to revert to a hack to get it to work. My first attempt reads from the istream but a word at a time. first.cpp #include …

Member Avatar for gerard4143
0
347
Member Avatar for invisiblemaa

I'm trying to solve Problem #54 of Project Euler, which is basically evaluating poker hands. My program currently outputs 383, but the answer should be 376. My full code #include <iostream> #include <string> #include <fstream> #include <vector> #include <sstream> using namespace std; //CLUBS=14; //SPADES=15; //HEARTS=16; //DIAMONDS=17; int value(char str){ switch …

Member Avatar for TrustyTony
-1
562
Member Avatar for jp071

Hello, Could anyone explain details about three different case and output. Here is the code and output: #include <stdio.h> void foo(int n) { n = 6; } void fooWithRef(int& n) { n = 6; } int main() { int n; foo(n); printf("Case_1 Result: %d \n", n); n = 4; foo(n); …

Member Avatar for MandrewP
0
135
Member Avatar for T0pAz

The problem is simple. I have LoadLibrary on my c++ app and I want to load c# library but I don't know the entry point.

Member Avatar for T0pAz
0
2K
Member Avatar for MrEARTHSHAcKER

Hi, I have read something on IBM's site about exception specification and pointers to functions: void (*f)(); void (*g)(); void (*h)() throw (int); void i() { f = h; // h = g; This is an error. } IBM says: > The compiler allows the assignment f = h because …

Member Avatar for MrEARTHSHAcKER
0
193
Member Avatar for vedro-compota

Hi there!) Guys please tell me - where can I see the realization (or custom realization) of fprintf in C++ ? I'm especially interesed in working with no fixed number of passed parameters. I need to made somethings like fpintf() by myself but i don't know how.... big thanks in …

Member Avatar for vedro-compota
0
178
Member Avatar for Valiantangel

I hav this code below.How can i use Macros , so that i can change at random "-" and " " without searching through the codes? #include <iostream> using namespace std; int main() { int row,col,n; cout<<"Enter an Integer number:\n"; cin>> n; cout<<("Numerical Pattern\n"); for ( row = 1 ; …

Member Avatar for deceptikon
0
118
Member Avatar for capton

Please i'm having problems sorting nodes in a linked list but i can sort the data members and i want to know if sorting the nodes themselves in the list is necessary at all. In other words are there instances where nodes are specifically needed to be sorted. Also, why …

Member Avatar for deceptikon
0
85
Member Avatar for pokie_da_codie

Instead of using User input , how can I take an parameter input and convert it to a string, where I can than check for for input values. char values[17] = "0123456789ABCDEF" ; char numIn[15]; int num[15]; int ob, nb, i;

Member Avatar for thines01
0
284
Member Avatar for FraidaL

This is a minor issue that I'm having in a larger program. The program is for factoring a second degree polynomial. The function below is supposed to find the factors, which is does, but let's say a=6, b=1, c=-12 so a*c=-72 and I want the two numbers that will add …

Member Avatar for histrungalot
0
631
Member Avatar for adeel381
Member Avatar for bgx90

This is my first time to try using STL maps. The code looks correct as far as I can tell, but when I try to compile a test file that does nothing but include the header for the class and declare a variable of that class, I am getting compiler …

Member Avatar for bgx90
0
3K
Member Avatar for FraidaL

This code is supposed to find the nth prime number (n being input by the user). I have the code to calculate whether a number is prime or not, but I don't know how to get the code to display the nth prime number. #include <iostream> using namespace std; void …

Member Avatar for WaltP
0
1K
Member Avatar for pokie_da_codie

Can anyone help me make a code or advice I need a code that takes 2 parameters eg. integer 123 and base number from 2 to 16. Using argv[1] and argv[2] any help greatly aprreicated

Member Avatar for WaltP
0
79

The End.