49,760 Topics

Member Avatar for
Member Avatar for ifrah qaisar

Read 10 numbers in an array. Each number must be between 10 and 100. As each number is read, print it only if it is not a duplicate of a number already entered.

Member Avatar for deceptikon
-1
45
Member Avatar for sharathg.satya

i saw that we should not use the combination of new operator and free for allocating and deallocating memory in c++.. Is this right? is there any reason other than saying that the combination is calloc/free and new/delete? please help me.. thanks in advance

Member Avatar for deceptikon
0
177
Member Avatar for Karkalash

Hiya: I have tried to reproduce this equation to simple reflect a ball after colliding with a paddle (or screen bounds) R = V – (2 * V[dot]N) N I don't want to take the easy rout of just negating the velocity but is my first time trying to implement …

Member Avatar for Karkalash
0
569
Member Avatar for ahoysailor

Hi, I'm having a problem with taking the user input from a richtextbox in Unicode and writing it to a Unicode text file. I'm able to read a different Unicode file and write it to the new file, but when it comes to writing the contents of the richtextbox to …

Member Avatar for ahoysailor
0
260
Member Avatar for zerohero

Hello I'm new here and I've been up two night's trying to figure out how to write a program that will convert numbers to word. If anyone can help please respond to the post. here is what I sort of figured out so far. As you can tell I'm still …

Member Avatar for Kalel Kristoff
0
813
Member Avatar for richardtreier

Alright. I am (attempting) to use this [URL="http://sites.google.com/site/rcorcs/download/systemsoftware"]http://sites.google.com/site/rcorcs/download/systemsoftware[/URL] simple database library in VC++ 2008 Express. I admit that I am a newbie to C++, since Ive used only "light" programming languages like python, php, java. To use it I have the header files, and as "lib" folder I have a …

Member Avatar for mike_2000_17
0
104
Member Avatar for triumphost

How can I forward declare a struct/custom type in my include? I'm trying to write an include but it keeps telling me incomplete type or type not declared.. I do not have a .CPP to go with it.. I wrote everything in here as I have never written an include …

Member Avatar for mike_2000_17
0
8K
Member Avatar for bobanderson93

so i have a char array that can hold up to 1000 items.. but it might not be filled up completely. How can i prevent the program from printing garbage on the screen after printing the real values from the array. btw i am reading from a file, sorting by …

Member Avatar for WaltP
0
115
Member Avatar for bobanderson93

the program wont compile because it found and error with ReadFromFile class method in the main.cpp file. Any help would be appreciated. class inventory deceleration in "Inventory.h" file [CODE]#ifndef INVENTORYDEF #define INVENTORYDEF #include <iostream> #include <fstream> int const MAXNAME=30; int const SIZE=2; class Inventory { private: int quantity[SIZE]; float unitcost[SIZE]; …

Member Avatar for Ancient Dragon
0
153
Member Avatar for stamatt45

I'm writing a program to convert Decimal numbers to binary, hexadecimal, and BCD as a refresher before i start getting code assignments in school. I'm almost done, but i have a seg_fault (compiler says decToHex function) in 1 function and i am hoping for some feedback on the others. I'll …

Member Avatar for raptr_dflo
0
3K
Member Avatar for clerisy
Member Avatar for dmanw100
0
118
Member Avatar for doboi

Hi, I'm new here so I'm not sure if this is the right place to ask for homework help. Sorry if it's not proper :) This is from my Data Structures class. I'm just about done with the assignment but it's giving me memory leaks and I'm not sure what's …

Member Avatar for MastAvalons
1
197
Member Avatar for surferxo3

I have the following input and my program is not running: 1 3 2 1 3 7 8 [CODE] #include<iostream> #include <cstdlib> using namespace std; int main() { int arr[7], min, i=0, j=0; for(int i=0; i<7; i++) { cout<<"Enter value at arr["<<i<<"]: "; cin>>arr[i]; } min = arr[j]; for(; i<7; …

Member Avatar for Lerner
0
231
Member Avatar for venky019

I got a problem regarding searching for a string in a file.txt. Program takes input from user and searches for the string and outputs the first string that finds. Ex: user enters NIW and program should output the string DANIWEB(DA'NIW'EB) I can get the input from user and I dont …

Member Avatar for Lerner
0
222
Member Avatar for bouldermash

[CODE]#include<conio.h> #include<iostream.h> void main() { clrscr(); long input,negaAr[10],posiAr[10]; for (int x=0;x<10;x++) { cout<<"enter:"; cin>>input; if (input<-1) negaAr[x]; else if(input>=0) posiAr[x]; } cout<<"positive:"<<posiAr[x]; cout<<"negative:"<<negaAr[x]; getch(); }[/CODE] i dont whats thee problem of this, ihave to input 10 integers and display the number of positive and negative.

Member Avatar for aashishsatya
0
86
Member Avatar for imsinu

can we pass condition of if statement as an argument in any language????????? [CODE]class Matrix { static void loop(char a,char b,char c) { int a[][]=new int[3][3] ; byte i,j ; for(i=0;i<3;i++) { for(j=0;j<3;j++) { if(a b c) System.out.print(a[i][j]+"\t"); else System.out.print(" "+"\t"); } } public static void main(String ar[]) { loop('i','>','j'); …

Member Avatar for JamesCherrill
0
4K
Member Avatar for denizen08

I have a project that requires us to perform matrix multiplication via multi-threading, using the Windows API. I've got the basic code running and everything is well under sane/ideal conditions. But if my input matrices go beyond 10x10 the program ends up failing on WaitOnMultipleObjects(...) and runs the main thread …

0
120
Member Avatar for mylotech

I'm learning linked lists in C++. In an exercise I have to duplicate H time a give item. So I thought in this method: [CODE]void duplicaNodo(int item, int &H, Pnodo &L){ //duplica un nodo H volte, scorrendo tutta la lista Pnodo Temp, Temp2; if(L!=NULL){ if(L->info==item){ for(int i=0; i<H; i++){ creaNodo(item, …

Member Avatar for mazzica1
0
255
Member Avatar for SmackTubby

So, I am fairly new to C++ programming, so if you can help me, please try to keep it simple...I'm still learning. What I'm trying to do is assign a score to a grade letter (A,B,C,D,F) and then display it. This is what I'm have: [CODE]string lettergrade1; string lettergrade2; if …

Member Avatar for SmackTubby
0
221
Member Avatar for bennetk2

I am unable to figure out how to check to see if there is more data in the file. I have a input file, where the last two lines are just new lines with new data. When I run my code, I get the last line of data in the …

Member Avatar for WaltP
0
183
Member Avatar for kbakersr

Hello, I am having trouble going about taking a text file with a bunch of entries, like A43 A32 B45 A35 B23 etc, and having the numbers with A infront stored in one vector and the numbers with B infront stored in another. Anyone have hints for me? so far …

Member Avatar for ravenous
0
149
Member Avatar for swissknife007

I am a beginner to computer graphics and I have to add animations to the image of my national flag which look like [URL="http://4.bp.blogspot.com/_R_714JbVSys/SbJm90IMkpI/AAAAAAAAAEo/IQQ_YyvV2_M/s320/indian+national+flag.jpg"]this[/URL]. I have designed the flag alright.But I don't know what kinds of animations are possible and how. Could someone please guide me how to add animations …

Member Avatar for peter_budo
0
656
Member Avatar for rfrapp

I'm writing a program to add two hex numbers of up to ten digits, and I'm recieving an "assertion failure," and I can't figure out why. Any help would be greatly appreciated. Thank you for you time! [CODE] // hex addition.cpp : Defines the entry point for the console application. …

Member Avatar for WaltP
0
289
Member Avatar for jsparger

Hi guys, I'm looking for a little help with Apache Xerces. I am currently trying to use Xerces-C++, but I'll soon be using Xerces-Java. As I look the the C++ programming guide and the DOM programming guide, a lot of my questions remain unanswered. The sample codes lack comments on …

0
98
Member Avatar for KazenoZ

Hello, Simple question this time, I hope, I have a program that collects an argument from execution on another program, the argument is the path to a file. Now, the problem is that when I try to read the argument to a string using argv[1], it'll only get the first …

Member Avatar for Shimano
0
1K
Member Avatar for fishsticks1907

I can seen to fix my linked list, i tried looking into other code for help, but most of the linked list examples online don't even work and are out dated: [CODE]#include <iostream> using namespace std; class list { private: struct node { int data; node *next; }*head, *tail; public: …

Member Avatar for Lerner
0
104
Member Avatar for Labdabeta

I have this code for AlphaBeta implementation and have created versions of the required interfaces that work perfectly (I have debugged them quite thoroughly). Unfortunately my algorithm keeps returning an empty vector and score of 0. Here is the code: [CODE]#include <vector> #include <limits.h> using namespace std; typedef vector<unsigned char> …

Member Avatar for Labdabeta
0
258
Member Avatar for myrongainz

i have done coding for the board but now I'm stuck on getting randomizing ship placement for player1 and player2 So far for ship placement all i have is the function prototype. [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> int placeship( int x, int z[ ][ 10 ] ); // function[/CODE] …

Member Avatar for Lerner
0
2K
Member Avatar for jryans10

Hi, I've currently got a dilema. I'm aware that from within a C++ program, you can use return values to get data from a function, but I am currently developing a Qt program, and at the moment I have 2 GUI's: 1- Main Window 2- Dialog The main window calls …

0
66
Member Avatar for firebird102085

I am just starting to teach myself C++ and i have no coding experience so please bear with me on this if I ask you to explain your reasoning behind your response. My code is: // operating with varables #include <iostream> using namespace std; //declarations char STAR; int PRIME = …

Member Avatar for MandrewP
0
4K

The End.