49,761 Topics
| |
Bored and just wrote this. Anything I did wrong? Anything that can be improved? Relatively new to C++ but I have the basic basics down(I like to think so anyway). [CODE]#include <iostream> #include <cstdlib> #include <ctime> using namespace std; void programIntroduction(); void gameLoop(); int playerChoice, cpuChoice, wins=0, losses=0, ties=0; int … | |
I have created two classes: [code]class dm_Step { public: char m_plus; char m_particle; float m_energy_sec; float m_xpos_sec; float m_ypos_sec; float m_zpos_sec; }; [/code] [code]class dm_Track { public: vector<dm_Step> m_track; } [/code] I have a data base with hundreds of lines of code in the following format: + gamma 2.306013 -0.213225 … | |
Hey, I am having trouble implementing a c++ function that will allow the user to enter a lower and upper bounds and reverse everything in a char[] in between the bounds, so if array is, char[] = {'A','B','C','D','E'}; and the user input was 1 and 4 for 1 as the … | |
Hi, I noticed many programmers accuse C++ as very hard language for GUI and very good language for the code. Is there any way to integrate 2 languages, C++ and any other language which is easy to make GUI with? Thanks. | |
The code below takes the quantity of tickets from the 55 tickets that is available and it stores the value in a text file. What I want the program to do is to store the amount of tickets that is available and then each time the program executes it will … | |
Here's the full assignment: [QUOTE]The ABC Corporation wishes to review a group of its products based on their performance in the prior fiscal year. The company has the sales data for these products for each quarter in the year. Having heard of your programming experience, the company has hired you … | |
Hi, I was wondering is there a way where you can sell limited tickets. For example there are 55 seats in a bus and 55 people bought the tickets for the bus,the people who want to buy those tickets for the bus must wait for an hour. How would I … | |
I am only allowed to use int, unsigned int and float. Must be accurate to the 7th significant digit. Currently I overflow 'float top' at an x value greater than 13. Thank you for your time. [CODE] #include <iostream> #include <iomanip> using namespace std; float sum=1,x, top=1,factoral=1; int main(void) { … | |
Dear all, I have problem with reading from ini file. My code is as follows, but it has Error with GetPrivateProfileInt. It cannot read and the error is : error C2664: 'GetPrivateProfileIntW' : cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion … | |
Hello all. A friend is shipping some items in a container so it gave me the inspiration to write a quick little program. This only took 20minutes at best so please bear that in mind. The basic idea is if the containers size is known, and the cost is known … | |
Currently working with graphical interface and dynamic object arrays, Got two text files with kinda same data on it, my current task is just to read and output that data. Problem is most likely either with my read function or function to determine how much data there is in files … | |
Hi all, I am doing something like this int f(){ umap::iterator p = mmap.find(s); if(p != mmap.end()){ ....... } } My memory usage is somehow constantly increasing. While exiting the function do I need explicitly delete the iterator p? Thanks in advance, _alen | |
Aoa, Hello All, i am having problem in this question Write a program that takes integer input from the user and store into the array dynamically allocated each time a new element is added. Your program should prompt user to take integers until he enters -1, which means end of … | |
Please is there anyway in outputting subscripts and superscript notations in c++ | |
#include <iostream> #include <string.h> using namespace std; int main() { char clear[200]; char cipher[200]; int x,i; cout<<" Enter a string:"; cin.getline(clear,sizeof(clear)); x = strlen(clear); for(i=0;i<=x-1;i++) { cipher[i] = clear[i]+3; } cipher[x] = '\0'; cout<<" Encrypted:" << cipher << endl; system("pause"); return 0; } Hey guys hope someone could help me, … | |
I want to find if Array B is present in array A(B is a substring of A).. i have written this small function but its not working as desired ..can anybody plz help and point out where i m wrong [CODE] bool substring(char A[],char B[]) { int aSize=strlen(A); int bSize=strlen(B); … | |
Dear Gurus, I am having this inventory program but can not give me the desired results.What am I doing wrongly? I want a user to enter and display results. [CODE] #include <iostream> #include <fstream> #include <iomanip> #include <cctype> using namespace std; const int DESC_SIZE = 51; // holds inventory description … | |
hi , I was trying to open a file using fopen() method. It's not opening all the time. some time it opens but the other time its getting crashed.... FILE* tmpfile = fopen(xxxxxx, "r") this is the code i am using.... and every time the value of xxxx is coming … | |
Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. [CODE]#include<iostream.h> #include<conio.h> class employee { int no; class data { int dd,mm,yy; public: void print_data() { cout<<dd<<mm<<yy; } }; data dob; public: data doj; void prin_t() { doj.print_data(); cout<<dob.dd<<dob.mm<<dob.yy; } }; void main() { employee 1emp; … | |
I was tried to debug to find an explanation to this but i still don't really understand the concept. Here goes. [CODE] //pass in value //973 456.2 77F //973 456.2 77F #include<iostream> using namespace std; int main() { char letter; int n; float m; cin>> m; cin.clear (); cin.ignore (200, … | |
Hello All, I have starting using Visual Studio Pro 2010 and I understand the very basics in programming. Currently I am trying to create a login system where users enter their usernames and passwords. I have been experimenting with trying to link Access database to MySQL but im having no … | |
hi all, I am trying to develop autocad like software in c and c++ .Which c and c++ editor is best to develop software..editor must be support graphics program in c and c++.. please give me suggestion ,link,and tutorial learn something | |
#include <iostream> #include <string.h> using namespace std; int main() { char test[256]; int x,i; int vowels; cout<<"please enter a word"; gets(test); x = strlen(test); for(i=0;i<=x-1;i++) { if(test[i]!=' ') { cout<<test[i]<<endl; } if (test[i]=='a' || test[i]=='e' || test[i]=='i' || test[i]=='o' || test[i]=='u' || test[i]=='A' || test[i]=='E' || test[i]=='I' || test[i]=='O' || … | |
hi all, I do not understand how i concatination of two string using pointer in c++. please can you give sugestion how i implement.. thanks in advance | |
Hey everyone, I am pretty new to writing procedures that deal with this idea of recursion. I am trying to get into that certain frame of mind but I am having a little bit of trouble at the last minute. My goal was to implement a text operation called swap … | |
| I am going to assume that gcc is the compiler people are using on their *NIX. so for that, I know that [CODE]#if defined(__GNUC__) [/CODE] will work. SO... for Centos, Solaris, HPUX, AIX, Linux, BSD, FreeBSD, OpenSUSE, Fedora, redhat, what #if defined()'s do I use to detect these OS's? |
I believe that my program in the attached file is almost finished. When I try to run the program,there are two error message that pop up. The error are the following: 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>c:\users\usr\documents\visual studio 2010\Projects\NEWLDIST\Debug\NEWLDIST.exe : fatal error LNK1120: … | |
Hi, I am having trouble outputting to many files [CODE] ifstream sim_dump; sim_dump.open("c_grain.sim_trj"); char dump_file[20]; int itr = 4000; sprintf( dump_file, "%d", itr); ofstream fout(dump_file); while(lammpsdump.good()) { //if(itr % 100 == 0) //{ fout.close(); sprintf( dump_file, "%d", itr); ofstream fout(dump_file); cout << "TIMESTEP " << itr << endl; //} ... … | |
ok so first of all my following code its suppose to read input from user and seperate the strings into commands and arguments.For example if i input changeDir hello , the tokenizer(which i already implemented) will split it and put changeDir into tokens[0] and hello into tokens[1]. Now what im … | |
Hey everyone, I wrote some code to create a deck of cards, described the deck and randomly deals 5 cards. First, I want to let everyone know that this is homework for my C-II college class, so I am not looking for any answers, but solutions or guidance in figuring … |
The End.