49,761 Topics
| |
This is my goal: - Search the list for a number and display how many times the number occur or display 'number not present' - Modify number and change each occurrence of a #, to the new number or display 'number not present' I have 2 functions. My first function … | |
the following example shows the problem: "int* pointername = new int" followed by "delete pointername" - no problem. however: "int* pointername = new int[8]" followed by "delete pointername" flags`an error during execution. (compile/built are passing ok). This happens with 2 very different compilers: vc++ (native) and djgpp one. looks like … | |
I get a problem when adding columns to a dataGrid. I keep adding columns with the code below. It works well until the column will come outside the right side of the dataGrids Widh. When it does, the program will get stuck for 2 minutes or so and the column … | |
Hi there.. I am currently making a snake game, by means of array set up of [50,50] of the snake, and the FLTK for the design of it's interface. As Quincy 2005 is the default IDE learnt in Univ, I do the c++ codings here. I already proceeded with the … | |
for(i=0;i<9;i++) { x[i] = rand()%9+1; for(j=1;j<9;j++) { if(x[i]==x[i-j]); i--; } } pls tell me how the rand() function work. urgent. as soon as possible. | |
Can someone please help me out? What are the pros and cons of C++ and Java? I've always been told that C++ is the ultimate programming language. It's powerful, fast, and used to run huge programs. But since Java is a close rival to C++, I was wondering what are … | |
Write a program that will prompt the user to type in a series of characters. Input these characters into a c-string (char array). For each character, if it is a letter, toggle the case (upper to lower case, or lower to upper case). All other characters leave as is. Print … | |
I am creating a code, and I'm getting this weird error. I'm sure its a stupid mistake, but I can find it. [quote] multiple definition of `Start()' first defined here ld returned 1 exit status C:\Documents and Settings\Andrew\My Documents\projects\equation\Makefile.win [Build Error] [equation.exe] Error 1 [/quote] And here is the code: … | |
I need a little help to get me going on how to start this program. I know how to create a string array, but I'm having trouble getting the overall structure for this program. Any help or links to helpful sites would be appreciated. Write a program that will read … | |
I have a c++ console program that alot of people are starting to download. But the program is updated around once a week. problem is, most of the downloaders never check for updates on the site. could add a feature to my program were it would do a check for … | |
Can someone please help me with figuring out why my codes does not run. I have tried to familiarize myself with how to get data from a file and discovered i need to use fstream. The data of the file is somethin like this: 19531029L 20081104L 19770615L 19300723L 19631122L 19410501L … | |
I was wondering if anyone could offer some suggestions on how to validate a social security number & their employee # that a user would input separately through prompts? The SS# would be in the form of xxx-xx-xxxx where the x's are 0-9. I tried using this function that I … | |
Hi there, I am currently doing the snake game for my c++ project. For your information, I am not majoring in computing or any programming course, but am majoring in Physics at Univ of Birmingham, UK. About my task, I employ the use of vectors as the main function to … | |
Im new to c++ and i'm tryin to compute the standard deviation of a set of floating point numbers using a data file. here I started my program and skip over things i didn't really know but can someone plaese help me. **************************************************************************** #include<iostream> #incluse<fstream> #include <cstdlib> #include <cmath> int … | |
For a lab, my instructor asked us to include an assignment operator with our class, but to hide it. Does this mean to declare it as private and just leave an empty implementation? Is this common/useful? | |
I have a problem with a code attempting to do a factorial of a number. For numbers 12 and below, the code works fine, but when I do 13 and above it outputs the wrong number. [icode] #include <iostream> using namespace std; int number; int number2; int main() { cout … | |
i have this given structure: [code] struct Tempscale { double farenheit; double centigrade; }; struct Reading { int windSpeed; double humidity; Tempscale temperature; }; [/code] i am then asked: define a Reading structure variable is this ok: Reading data; write statements that will display following data: wind speed : 37mph … | |
Hi, I was coding the following program.. [ICODE] // Program takes work hours and rate per hour and gives total // salary after tax, if work hours are over 40, its increased by 1.5x. #include <iostream> #include <conio.h> using namespace std; int main() { double hr_work, hr_rate, taxed_total, total; cout … | |
[CODE]std::string s="s1"; std::cout<<s<<std::endl; { std::string s="s2"; std::cout<<s<<std::endl; };[/CODE] Why can I have two variables with the same name existing like this? | |
Ok, well I am new to c++ and have been trying to get the basics down. I have a class assingment which require me to read numbers from a file and store them into a vector as long int. An example of the file would be : 19531029L 20081104L 19770615L … | |
Hi everyone, basically i'm writing a simple program in c++ to trigger a beep from the internal speaker much like a musical keyboard except i'm having trouble with capturing key press how would i be able to trap a key press then initiate a beep, i have tried using kbhit() … | |
i want to create a hash table ( independent rehashing ), using STL LIST... in Independent rehashing we use a function to we need to generate the index then check if there is any collisions if there is we need to rehash it and then put it in to the … | |
hi. i have to do addition,multiplication,division and substraction of large numbers using c++. Using pointers and struct .I m sending some code.plz if anyone can do this program help me. here r some code plz send me on [email]fri_003@yahoo.co.in[/email] as soon as possible. [code=cplusplus] #include<stdio.h> struct node { long int … | |
Hi, I am using the STL container for stack. <include> stack; I wish to check whether the integer is already in the stack or not before adding it into the stack. If it is in the stack then i do not need to add it. But if it is not … | |
I am new to the templates.. I was trying to implement templates in my x programs.... and i am stuck ... help me... problem is with the "search" function when i was not using templates search function was [B] Stack::Nodeptr Stack::search(char item)[/B] and worked perfectly fine.. when using templates... i … | |
Is there a way for example, to use WGET, inside of a C program? I want to download the text of a website's index.html (ie [url]www.google.com/index.html[/url]) and then send it over to another program via sockets. Is this possible? | |
I wonder for if I have a made a formapplication in VC++ 2008 Express Edtion that consists of 10 forms and I am for the moment writing code in Form10 and then want to compile and test the function. What I wonder is if I only can compile Form10 and … | |
[code] class Date { public : Date(); void getDate(int,string,int); private : int day; string mth; int year; };//end class //getdate void Date::getDate(int& inDay,string& inMth,int& inYear) const //error here { inDay=day; inMth = mth; inYear=year; } [/code] I'm doing up a date class. Am doing a class function getDate to return … | |
Hi guys, right now I am an amateur in the world of programming and am starting to "train" myself by thinking of ideas for a program and figuring out how to write it. So right now, my first real undertaking I have devised is to write an itemizer where the … | |
Hi guys.. I'm facing a problem in my project. Basically its a small project for a retail store inbound section. The goods come in cartons and the user enters the carton ID in the UI to accept the carton. In the backend the carton details get updated in the table … |
The End.