49,761 Topics
| |
There are two way to define a character array constant: 1. const char* const OUT_STRING="hello world"; 2.const string OUT_STRING="hello world"; which one is better? why? | |
new guy in this sphere, dont bash too much :S [code] #include <iostream> using namespace std; int main() { int x,y; cin>> x; cin>> y; if (x==0) cout<< "x = 0"; else cout<< "x isnt 0"; return 0; } [/code] this piece works ok but if i add 1 more … | |
can any body here knows how to create a program that will count the vowels and constants for example: the quick vowels:3 constants:5 can any one help me or can any one have idea on doing that using #include <string.h> | |
Hello there! I was asked to replace the bitmaps in an existing software. The software was compiled using Visual C++ 8. Do you guys have any idea how to go about this? Cheers! | |
hi... I have been assigned a task of porting Windows DLL on Linux... DLL is being created using C++ and IPP (Integrated performance Primitives,set of libraries). VC++ IDE has been used for wring the DLL... I know that in Linux Shared Object is being used in place of DLL... But … | |
Hey everyone! I have been working on this project for about a week now. It reads in a text file and outputs how many times the top five characters are used, what the percentages are for the top five compared to the rest of the ASCII characters, and shows the … | |
Hi i have just begun to develop a calculator in C++.net. I have created 10 buttons on the form 0 to 9 and the usual operands + - * / = etc. I want the code to work out the preceidence i.e. * before / etc but cant seem to … | |
can anyone here who knows where can i find the posted one problem that is to convert the month-day-year birthday to a simple day like sunday?? and who knows the answer to this problem using getdate setdate?? | |
I want to make some functions that I expect I will use again and again, but I don't want to copy and paste them everytime I make a program that will use them. My thought was to make a .h file with a namespace. Would that work? Or would I … | |
im using eclipse with CDT. my program works right now as a single source file. i want to split into various, so is easier to keep coding. i have problems with includes and stuff. what is the right way to do this? i didnt find any tutorial for this.. thanks … | |
I am trying to open a file with this code but wonder what extension this file has. My project is under this path: c:\\Documents and Stteings\\Jennifer\\My Documents\\Visual Studio 2008\\Projects\\Form1 Under this path I have a File that is named "Form1". If I doubleclick this file VC++ opens. The problem though … | |
How to count how many (3, 10 appears in data? I have done a little bit programming but abnormal program. (3 , 10) (3 , 31) (3 , 51) (3 , 71) (3 , 78) (3 , 97) (3 , 105) (3 , 113) (3 , 135) (3 , 138) … | |
How is it possible in C++ .NET to open a file on the computer. Lets say that I am trying to open this file. Is this possible to do. In this case, Wordpad will open. Thanks [code] "C:\\WordPadFile.rtf" [/code] | |
Hi again; Today I've got some silly questions about the translation of an algorithm to c++ :S (hey matrimkar, I found something that should work!:idea: ) well, my questions are in comments in this code: You can just read the first 2 paragraphs of the code, the 3rd one is … | |
So I have writing to a file and reading from a file. Now I need to be able to find specific data that was previously entered and saved to that certain file. Here is the code I have so far. [CODE] { ofstream myFile ("words.txt"); if (myFile.is_open()) { myFile << … | |
I need to sort a list with a bunch of numbers in separate columns. How would you sort a linked list with a bunch of numbers in separate columns. Anyone have any good examples to share or point me in the right direction. Please help - SEOT | |
I have a program that consists of 2 Forms in C++.NET. When I open Form1 that is my "StartForm", this Form comes up in the TaskBar as all applications and Folders etc on the computer. So when I open Form2 from Form1. Both these Forms will appear in the TaskBar. … | |
Following along a tutorial I entered code for a person to enter the age of five students. Then, the program is supposed to divide the five ages and display the result. It allows me to enter the ages, but as soon as I hit enter after inputting the fifth age, … | |
I have a .txt file that contains a lot of text. I will read the whole text file and output a new textfile with one change that is this: The txt file that I will read could for example look like this: [I]Value1 Value2 Value3[] Value4 Value5[][/I] What I am … | |
I've an old C function that calls a function pointed by a global function pointer. How do I get it to call a member function of a class object determined at run-time. It'll be complied in a C++ project of course. My main motive is reusability here. So I don't … | |
[CODE] [LIST=1] [*]void selectionsort(int numbers[],int arraysize) [*]{ int i,indes,large,j; [*] for(i=arraysize-1;i>0;i--) [*] { large=numbers[0]; [*] index=0; [*] for(j=1;j<=1;j++) [*] { if(numbers[j]>large) [*] { large=numbers[j]; [*] index=j; [*] } [*] } [*] numbers[index]=numbers[i]; [*] numbers[i]=large; [*] } [*]} [/LIST] [/CODE] i have been able to understand upto 7 line. can someone … | |
If I have a file like this and I want to copy this "File1" to "File2", how is this possible to do. So I will copy File1 so the new file with have the name "File2.txt". I know that: std::copy member exists but are not really sure how to use … | |
class matrix { int **p; int d1,d2; public: matrix(int x,int y); //constructor allocates block of specified size /*I am not specifying contructor code*/ void get_element(int i,int j,int value) { p[i][j]=value; } int put_element(int i,int j) { return p[i][j]; } // [U][B]return statement encountering access violation during runtime , Help!!![/B][/U] }; | |
hi, i would like to code a toypiano using SDL and c++.--a simple program which will emit a note when a graphical representation of a piano key is clicked. how do i call a particular midi note(corresponding to piano note)using SDL.(i am beginner with SDL and midi stuff,with adequate knowledge … | |
I'm so new to arrays, I've read, I've made boxes...and yet I'm still clueless. So my task is to make a bingo card, so far I've made one column of numbers that don't repeat...something I'm very proud of, but to do that same thing with different ranges for 4 more … | |
Hi there! I'd like to check if a string is preceeded by another one. More precisely in this example i would like to check if there is "lion" right before "sleeps". Im using rfind() to search backwards but for some reason it starts the search from the beginning of the … | |
I'm working on a project that is supposed to parse through a text file (about the length of a book or small dictionary) and print out the index. The program does not need to keep track of the frequency of the word. The data structure I'm using is a binary … | |
Hey I know i am over looking somthing small but can i get some help on line 23 [code](strcmp(chartryname, charname)==0 && (chartrypassword, charpassword) ==0){ [/code] I know this will not work its just to show what i am trying to do. I need to check two pairs of strings how … | |
[code=cplusplus] /////////interface //appication.h #ifndef APPLICATION_MAIN_H #define APPLICATION_MAIN_H #include<string> using std::string; class appliance { protected: string Manufacturer; string Type; public: appliance(string a,string b); ~appliance(); void setManufacturer(string a); string getManufacturer(); void setType(string b); string getType(); void showDetails(); }; #endif [/code] [code=cplusplus] ///////implementation//////////////////// //appication.cpp #include<iostream> using std::cout; using std::cin; using std::endl; #include<string> using … | |
I'm having problem w/ this codes in bright red, when i'm trying to enter a name the first two letters are always not shown or when inside the inner looping, it don't show what the inner looping is containing. [code] #include <iostream> #include <iomanip> [COLOR="red"]#include <cstdio> // used for reading … |
The End.