49,757 Topics

Member Avatar for
Member Avatar for technogeek_42
Member Avatar for technogeek_42

how can i use a string? what should i include to run string like "technogeek" is it #include <string.h> or what and what is the syntax for string

Member Avatar for Ancient Dragon
0
92
Member Avatar for kylcrow

I was given the problem to write a class called block cipher to take in a text file and output the same text file after it has been encrypted. I have to use this header file... [CODE]#include <iostream> using namespace std; class block_cipher { public: block_cipher(); // Constructor void finish(); …

Member Avatar for kylcrow
0
136
Member Avatar for MKQ

Hello Everyone, Need your comments on : "Can over running of array lead to the catastrophic failures ? " May be the answer is YES. "Then, why does not c++ provide bound checking on array operations and who is responsible to prevent array overruns ?" regards, MKQ

Member Avatar for Duoas
0
81
Member Avatar for lazyboy292

i have to write a code for compression of lines with redundancies. You are supposed to enter a line of code--for example(YES I CAN! YES I CAN! YES I CAN!) and your output should look like this (3YES3I3CAN3!) so the codes job is to count the number of times a …

Member Avatar for John A
0
104
Member Avatar for CoolGamer48
Member Avatar for snowy_shoryu

the title says it all.. if any1 happen to see one , can post the link to me? thanx!! i need it to do my assignment .. but i cant find any program as long as that! tq! my assignment task is to find a program written by other ppl …

Member Avatar for TimeFractal
0
237
Member Avatar for andyg55

Hi guys, I have an array which reads in a file and displays it to the screen. The output is as follows: 1 0 0 2 0 0 3 0 0 4 1 2 5 1 2 6 0 0 7 3 4 8 5 6 9 7 8 10 …

Member Avatar for VernonDozier
0
293
Member Avatar for GPXtC02

As the title states.. is it possible to pass two variables back from a float function.. one through 'return variable' & the other through reference? If it is i will post the code.. but after hours of debugging & the program is still not recognizing the changed reference parameter (but …

Member Avatar for GPXtC02
0
84
Member Avatar for sjcomp

Hello, I have a vector of smart pointers and I'd like to NULL smart pointers in reverse order. Smart pointers are done with boost::shared_ptr<>, this is the code: [code] // List of pointers typedef boost::shared_ptr<int> TSmart; std::vector<TSmart> Vec; // Make sure that everything is NULL std::transform( Vec.rbegin(), Vec.rend(), TSmart()); [/code] …

Member Avatar for sjcomp
0
109
Member Avatar for winrycool

i would like to add graphics to to the "8 queens problem" with a 8*8 grid colored in black and white with the 8 queens placed on the board and moving them using the arrow keys is that possible plz help me it is counted for my annual exam i've …

Member Avatar for Narue
0
245
Member Avatar for blcase

[code] class Movie{ private: string director,title,genre; public: Movie(){ director="";title="";genre="";} int main(){ Movie a();} [/code] I am having problems with my default constructor. my program compiles but it gives me a warning "warning C4930: 'Movie a(void)': prototyped function not called (was a variable definition intended?)" and if i try to run …

Member Avatar for Narue
0
2K
Member Avatar for CoolGamer48

Don't know if anyone here will be able to help me - but here I go. I'm reading [i]Beginning Game Design[/i] by Jonathon S. Harbour. In a chapter on DirectSound, the author says to go the DirectX SDK, and then go to \samples\c++\common to get four files (dsutil.h, dxutil.h, dsutil.cpp, …

Member Avatar for CoolGamer48
0
116
Member Avatar for spyrilautte

Hi all! I've been searching the internet and various C++ books for quite some time now, and I appear to have reached a brick wall. As suggested in a given algorithm written by my professor, during input validation, if the stream goes into failure, I am to "reset cin" followed …

Member Avatar for spyrilautte
0
3K
Member Avatar for coolerli

[code=c++] #include <stdio.h> #include <iostream> #include <string> #include <vector> using namespace std; vector<string> g_split_string(const std::string& str, const char c) { vector<string> v; cout << str << endl; string::const_iterator s = str.begin(); bool flag = true; // continuous c while (true) { string::const_iterator begin = s; while (*s != c && …

Member Avatar for Ancient Dragon
0
123
Member Avatar for veronicak5678

-------------------------------------------------------------------------------- I am trying to do a program that will use a function to search a string for an occurence of another string. Can someone please tell me what is wrong with this? [CODE]#include <iostream> #include <cstdio> #include <cstring> using namespace std; void replaceSubstring(string, string, string); int main(){ string string1, …

Member Avatar for veronicak5678
0
444
Member Avatar for Blythe24

Hello(repost)- I am reposting because I didn't get the answer I needed. My teacher gave us this problem in a lab and I need help with it. Basically, he wants us to write an algorithm to count symbols. The user will provide anywhere between 3-10 symbols and then an initial …

Member Avatar for jazzman05
0
104
Member Avatar for viper89

Hello, i have rather curious question, i have an array of integers, but i need/want to put them as a single strings which separates the rows with newline characters... does anybody have any idea on how to create a string from an array of integers? please, and thank you!

Member Avatar for Ancient Dragon
0
104
Member Avatar for bhutta2005

Create a class in C++ name Height with the following Data members Feet Inches The Height class presents Height in Feet and Inches. For instance, Height (4, 3) means 4 feet and 3 inches. The Height class you will design should have the following features. Constructors Class must have 1. …

Member Avatar for Ancient Dragon
0
105
Member Avatar for kitin

this is a part of my graduation project on Minority Game, I have problem with changing MemValues after first it iteration, at the first iteration I need random values, but after that i will have 1 Last win wihch would be the temp[m_nMemory-1] and then eache value should be shift …

0
65
Member Avatar for chocl8drop

I am trying to write a program that will flip a coin 100 times and count the number of times it lands on heads as well as the number of times it lands on tails. I have a function, flip, that returns 0 for tails and 1 for heads. When …

Member Avatar for chocl8drop
0
613
Member Avatar for CoolGamer48

Hey, Is there anyway to control a volatile number of objects (don't know if I'm using the right term here... I mean when you don't know how many of an object you're going to have at any one time), like bullets in a shooter. If you have a bullet class, …

Member Avatar for VernonDozier
0
123
Member Avatar for kylcrow

Hello, I have been stuck on this for awhile, and can not seem to get it to work exactly correct. I am trying to read in a file ("in_text.txt") and print out it's contents to the screen for now (eventually i will manipulate the data with a block_cipher class). Here …

Member Avatar for kylcrow
0
183
Member Avatar for CodyOebel

Ok.. I use c++ numerous times to stream an output to script's to do further operations. Sometimes I need an email script, and will output one and manipulate the script with c++. As dumb as a question as this is I just want to clear my confusion before I go …

Member Avatar for twomers
0
75
Member Avatar for ShyamalShah

Introduction Reverend Zeller developed a formula for computing the day of the week on which a given date fell or will fall. Suppose that we let a, b, c and d be integers defined as follows: a = the number of the month of the year, with March = 1, …

Member Avatar for neosomosis
0
109
Member Avatar for free2rhyme2k

Hi there I am writing a simple while loop which terminates on the condition that a certain value is found, as follows [code] std::string question = q.quest().que(); std::string answer = q.ans().answer(); std::string graphic = q.inf().info(); std::string english1; std::string english2; std::string arabic1; std::string arabic2; while((answer != english1) || (answer != english2)) …

Member Avatar for neosomosis
0
121
Member Avatar for IIMarckus

Hey guys, I just have a simple (?) question. What difference is there, if any, between [inlinecode]cin[/inlinecode] and [inlinecode]std::cin[/inlinecode] (for example)? If the latter is better form, why is it so?

Member Avatar for IIMarckus
0
137
Member Avatar for Diabloizzle

I am having problems with jGRASP. Whenever i try to compile... i get the error... "g++.exe: installation problem, cannot exec `cc1plus': No such file or directory ----jGRASP wedge2: exit code for process is 1. ----jGRASP: operation complete." Does anybody have a quick fix? I already have MinGW installed.

Member Avatar for Ancient Dragon
0
76
Member Avatar for jimmy.rocks1

i m trying to terminate a thread when it is executing . could anyone help me how to go about this... thanks, aravind

Member Avatar for Ancient Dragon
0
125
Member Avatar for andyg55

Hello!! I have an array filled with figures stored in an input file. My program has read the input file, and filled the array with the contents. I also have a random number generator. I have made this make 2 random numbers between 0 and 1 at a time. I …

Member Avatar for VernonDozier
0
228

The End.