- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
"Write a program that reads in ten numbers to an array. The program then reads the array and displays distinct numbers (i.e. if a number appears multiple times, it is displayed only once)" for example: 1 2 3 4 [B]5 5 [/B]6 7 [B]8 8[/B] 9 1 2 3 4 … |
|
I have an image (frame.bmp, uncompressed, resolution 640*480, 3bit depth, 900KB size) stored at C:\Frame.bmp. I want to load it and put it in my program as an array a[N][M], N=479, M=639. After that to modify its elements (e.g thresholding) and create a new array B[479][639]. Finally, to store it … |
|
Hello! I want to make a trainer (just for that not because I need to cheat at a game). I have an application made by me (Untitled1.exe......ftw!) when I press any key it makes the number from x to x++... Another program I need is when I run it to … |
|
Hi all, I have following string 0x0002,A5651QPR87GBZ094RTF52,D,A,000001,ABC ,10000.00 , EOT i need to split the above using ',' as the delimiter & put those in to the following string variables. 1.Command 2.Key 3.Msgtype 4.number 5.name 6.amount pls reply me as sap. Regards |
|
I'm working on an assignment for Computer Science 121. The assignment is to write a program that prompts a user to input an integer and then outputs both the individual digits of the number and the sum of the digits. For example, it should output the individual digits of 3456 … |
|
Hi, everyone: I want to create an infinite array, where normally we initialize an array like this: [code]int array[10];[/code] There is 10 spaces in the computer reserved for array[]. However if I wish to have an array with no limit space, but the number of spaces of an array is … |
|
I am trying to initialize a vector inside a class's constructor, and I want the vector to be of type 'this' [code]std::vector<this>[/code] didnt work, [code] void* type = this; std::vector<type> [/code] that didn't work either, is there any other way to do it? |
|
This subroutine is very basic, however I am struggling. When the user types q (or Q) into the input when asked for the vendor name, the program should return false... However, this function is always returning true. MY if statement is clearly not working: (*vendorName != 'q' || *vendorName != … |
|
If i have 5 int variables with values stored in them, is there a command to find the lowest valued variable? |
|
What wrong with this code? #include <sstream> #include <string> using namespace std; int main() { string a = ":)"; string b = "John"; int c = 2; string d; stringstream str; str << a << " Hello " << b << " bye " << c; d = str.str(); printf("%d",d); … |
|
Hi, I am getting the following error: test.o(5209) malloc: *** mmap(size=2097152) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug I am using finite recursive function in my program. Please help with my query. Thanks |
|
I'm not too sure why I'm getting memory leaks...hopefully someone here is wiser than me, and can help me find it :P . [code=cplusplus] #include "Canvas.h" CDrawer CCanvas::gCanvas(RGB(0,0,0), 1); int const GREEN(20000),BLUE(50), RED(200), THICK(3); CCanvas::CCanvas(void): _iSize(0), _cptPoints(0) { } CCanvas::CCanvas(CCanvas const & tmpCanvas): _iSize(tmpCanvas._iSize) { if (_iSize > 0) { … |
|
i need help removing spaces from a string..how do i go about this?? i have to report back the number of spaces too but ive been able to do that thnx (i dont want to use any of the string functions in the string library) [code] #include <iostream> int stripspaces(char … |
|
I have been working on this assignment for a while and cant get the end result to work. Can anyone help? Assignment [QUOTE]Write a function called sumTo that takes as arguments two integers. Your function should use a loop to sum all of the numbers between the two (This includes … |
|
I compiled this code in dev c++ and i got 0 warnings and 0 errors, so it was a clean compile and whenever i run the exe i get this error which says assembler.exe has encountered a problem and needs to close. And gives me the error report thingy for … |
|
Hello I have written my program and right now I am stuck in something that I thought that was going to be easy. I have the [B]char buffer[/B], which receives from the serial port some letters and 2 numbers at position 3, lenght 2. I want to extract those numbers … |
|
Anyone know how to pass an entire hashmap to a function?? The hashmap is hash_map<string, wordStruct> hashofwords; wordStruct contains information about each word in the hashmap. |
|
I really don't know where to start and to be honest I really don't know what I'm doing. I was given this project and we never went over these topics in class or the previous class. My attempts to wing it are not going so well and quite frankly its … |
|
Is there a way to save in a text based game through the MSDOS window? I want to be able to save the variables that store the mana, health, ect of a player. |
|
Dear DaniWebbers, If you would all be so kind to help me, I have a problem here and I am trying to know why this happens... In a large application I am working on, I need to have a struct of some sort with a sub struct-array and the sub … |
|
Does anybody have any idea why the following code causes a memory error? Thanks everybody in advance :D [code=CPP]#include <stddef.h> // some older implementations lack <cstddef> #include <time.h> #include <math.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <list> #include <deque> #include <set> #include <iostream> #include <iomanip> typedef double element_t; using … |
|
Hi I'm was a c++ programmer for 7 years past with VC++ then go to Java and now return to c++ , I've search for VC++ and its seems big change now (VC++ Express Edition ) . I looking for free VC++6.0 or any other easy/free editor for c++ programming … |
|
The below program works fine for a input file that has only one line. but goes to an infinite loop for a multiline file. Kindly suggest. [code][COLOR="Red"] #include<iostream.h> #include<conio.h> #include<fstream.h> void main() { char data[10000]; int i=0; ifstream ofile("c:\\temp\\welcome.txt"); cout<<"File opened\n"; // clrscr(); ofile.seekg(-1,ios::end); while(1) { if(ofile.tellg()==-1) break; i++; ofile.get(data[i]); … |
|
I use VC++ 6.0 1) This small program simply reads infomation from file “in.txt” and write it in file “out.txt”. (copy contents from this file to another) 2) It doesn’t work. The compiler issues an execution-time error. And the ouput text file “out.txt” is empty. 3) I don’t know why … |
|
Read line by line from data2.txt, compare with data1.txt lines, if match , remove , else append to a new file (result.txt) . mathces are exact string matches, both are text files. And i also need to make the directory of the file to be user input, so this program … |
|
Hi, i am required to make a game, here are the details: zombie island This is a simple turn based game. Set up a 2d grid. Onto the grid randomly position holes, zombies and a man (each represented by a simple character e.g. O Z and M). The man moves … |
|
Hi, i am trying to write a program that would work much like the tail command in UNIX. The idea is to print the last 10 lines of a file. I started off by finding out how many lines were in the file, then attempted to seek to the appropriate … |
|
I wanna have my program be able to let the user manually open a text file by destination and retrieve data from it, I have everything like ifstream good, i just need to know how to let the user cin something like C:/files/myfile.txt, but with the ifstream format I need … |
|
hello all i want to know the uses of function returning by refrence and how to use them i tried this but it gave an Error [code] int& sumz(int x,int y) { int *sum = new int; *sum = x + y; return sum; }[/code] |
|
Hi, Is there any way to store huge numbers (for example, a number with a million digits) in a C program and be able to perform operations on it ? Thanks.. |