51,593 Topics

Member Avatar for
Member Avatar for mahdiahmadirad

Hi Dears! I am a Beginner, Please Help Me. If you Can Help me to find out how to sort a 2d arrays of characters with [U]recursive bubble[/U] sort algorithm. I have got something but it doesn't work. what is my mistake? I Did codes below So far, but it …

Member Avatar for cikara21
0
802
Member Avatar for mostermand

Hi. I am making an application that will use the screen and do something with it(live). My problem is that when i do that i get the previous screen made by my program last time i updated the window what would you suggest i do? any help would be appreciated.

Member Avatar for mostermand
0
66
Member Avatar for winrawr

[icode] someprogram.cpp -----------> #include<string> | | #include"someheader.h" V someheader.h --------------> #include<string> [/icode] what happens if I do this? Is it necessary to include the headers into all files that use them, or can you just go [code=C++] #include<string> #include... #include"someheader.h" #include"anotherheader.h" [/code] and string and other required headers will be …

Member Avatar for cikara21
0
87
Member Avatar for athlon32

I don't know if this is the right place to post this but here goes nothing. I know this is such a cliche from us C++ coders, but I wanna make my own open source OS. I would use something like BSD or Linux, but I really wanna use C++ …

Member Avatar for shasha821110
0
113
Member Avatar for Faterin

I use this [code] #include <fstream> #include <iostream> using namespace std; class Student { public: char FullName[40]; char CompleteAddress[120]; char Gender; double Age; bool LivesInASingleParentHome; }; int main() { Student one; strcpy(one.FullName, "Ernestine Waller"); strcpy(one.CompleteAddress, "824 Larson Drv, Silver Spring, MD 20910"); one.Gender = 'F'; one.Age = 16.50; one.LivesInASingleParentHome = …

Member Avatar for damani88
0
257
Member Avatar for madrang

Hi, i'm making my own game engine on sdl + opengl i also know that i can manage file for my setting and save game that way (i am on windows) [code] #include <windows.h> void ini::setfile(std::string name) { name += ".ini"; std::string directory; char path[1024]; GetModuleFileName(NULL, path, 1024); directory = …

Member Avatar for madrang
0
109
Member Avatar for Pabs666

pretty basic problem but my C++ is pretty far back here's my problem I have to read a text file and parse all the different field ex: 001 R0S11 182983 2009/02/22 45607 002 R0S12 182983 2009/02/23 45707 003 R0S13 182983 2009/02/16 45807 004 R0S14 182983 2009/02/04 45907 .... once I've …

Member Avatar for Ancient Dragon
0
95
Member Avatar for umen

Hello all i need to be able to modify Microsoft office existing file like or rtf files adding text and misc options to the document and then saving it i don't what to be restricted to windows because most likely the process will be running on Linux . what is …

0
75
Member Avatar for Teethous

Hi. I'm David a newbie. I have just started Classes in C++ and I'm doing a GPA Calculator program. I have most of the program working but the average calculator seems to be giving me trouble. Please help. This is open to constructive criticism. All inputs will be gladly appreciated. …

Member Avatar for Comatose
0
108
Member Avatar for Manutebecker
Member Avatar for Manutebecker
0
112
Member Avatar for ademsaykin

[code] #include <iostream> using namespace std; struct Mytime { int hours; int mins; }; int timecmp( Mytime t1, Mytime t2 ) // compares two Mytime values { if (t1.hours == t2.hours) { if (t1.mins == t2.mins) { return 0; // returns 0 if times are same } else // mins …

Member Avatar for Murtan
0
189
Member Avatar for azwraith69

hello,, i need help on how to open files by using variable names.. here's my function: [QUOTE][icode]void stringSearcher(string filename, string search) { ifstream file; file.open(filename); if(!file.is_open()) { cerr<<"File can't be open..."<<endl; exit(1); } string line; while(!file.eof()) { getline(file, line); if(line.find(search)==0) { displayTitle(line); exit(1); } } }[/icode][/QUOTE] my problem is that …

Member Avatar for azwraith69
0
143
Member Avatar for clutchkiller

what does everyone else use? Another question i have is if there are any significant advantages of VC over Dev? I was figuring out if i should make the switch or not.

Member Avatar for TheBeast32
0
134
Member Avatar for oblivion4

Hi, I'm pretty new to windows programming, and I'm trying to learn from an example. However, I'm encountering some compiler errors that I think are caused by my strings not being made up of wide characters. (correct me, i could very easily be WAY off) winMain() requires parameters of the …

Member Avatar for oblivion4
0
125
Member Avatar for anuroop0707

Hello, I am trying to write a program where i have to read a CSV file(obtained by converting an excel file having only 1 column of integers) into an array and then to display the same array as another CSV file. I am using Turbo C++ 4.5. I've tried, but …

Member Avatar for Lerner
0
254
Member Avatar for atman

Hello., Im very new to C++ but im trying to resolve a fragment of the following code: [CODE] #include <iostream> using namespace std; const int NO_STEPS = 4; void s(int* a, int i); int main ( ) { int i, a[NO_STEPS] = {2, 4, 1, 3}; for ( i = …

Member Avatar for Rashakil Fol
0
134
Member Avatar for manpreet tiwana

I guys i have questions to answer : if anybody knows the answer please reply the questions : 1. What is objector programming? explain why an object oriented program is more rebust than structured programming?\ 2 Write a recoursive program in C++ to compute factorial of a given integer n …

Member Avatar for Rashakil Fol
0
84
Member Avatar for Mighty

I am currently taking a C++ program at my college and it all just seems foreign to me. I am having some trouble with this problem.. The Yukon Widget Company manufactures widgets that weigh 9.2 pounds each. Write a program that calculates how many widgets are stacked on a pallet, …

Member Avatar for Mighty
0
352
Member Avatar for Phil++

Hey what I am trying to do is convert the total amount into Euros, what would the calculation be please? The user enters the current rate of Euro Thank you :)

Member Avatar for Alibeg
0
94
Member Avatar for littleson

Hi, i am new to programming.. i have a code like [CODE]#include<iostream.h> using namespace std; int main() { int x,y; int *p1,*p2; p1=&x; p2=&y; *p1=10; *p2=*p1; p1=p2; *p1=20; cout<< x << y; return 0; } [/CODE] I do not understand it.. output is x =10 and y=20.. But both x …

Member Avatar for Narue
0
92
Member Avatar for clutchkiller

I want to make an if statment that checks for the size of a text file. What is the syntax to declare that? if( txtfile.txt = 5kb || txtfile.txt = 10kb ) { blah blah } ????? thanks

Member Avatar for William Hemsworth
0
92
Member Avatar for FBIRyan

[CODE]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <iostream> using namespace std; int Factorial(int iNum); int main() { int aNum; cout<<"Enter a number: "; cin>>aNum; cout<<Factorial(aNum)<<endl; system("PAUSE"); return 0; } int Factorial(int iNum) { cout<<"We are at number: "<<iNum<<endl; if (iNum <= 1) { cout<<"We are at number: "; return 0; } else { return Factorial(iNum …

Member Avatar for FBIRyan
0
123
Member Avatar for neoangin

Hey! Worked on one problem couple days ago and then found code on internet that did almost the same: [CODE] map<string,int> stringCounts; string str; while( cin >> str ) stringCounts[str]++; map<string,int>::iterator iter; for( iter = stringCounts.begin(); iter != stringCounts.end(); iter++ ) { cout << "word: " << iter->first << ", …

Member Avatar for neoangin
0
153
Member Avatar for mattwaab

Hey, i am working on a project in which i am making a minesweeper game. The game part was written by my prof. all i had to do was make the class and header to run the background of the game. I have done so successfully, but i am having …

Member Avatar for mattwaab
2
255
Member Avatar for mahdiahmadirad

Hi, Guys I am a beginner please help me. I wrote something like this: [CODE=cplusplus] #include <iostream.h> #include <string.h> #define number 1 #define length 35 char student[number][length]; int i,j,k; char *BlankImprover(char *); void InsertInfos(void); void main(){ InsertInfos(); for(i=0;i<number;i++) for(j=0;j<15;j++) cout<<student[i][j]; } void InsertInfos(){ char name[15]; for(i=0;i<number;i++){ cout<<"Enter Student Number <"<<i+1<<"> …

Member Avatar for mahdiahmadirad
0
97
Member Avatar for Jacky1

am trying to append to file but its not going correctly every time it fail to connect to file [code] #include<iostream> #include<fstream> using namespace std; int main() { fstream file; char word[256]; file.open("StudentInfo.txt",ios::app); //file.open("StudentInfo.txt",fstream::app); // wont work too if(file.fail()) { cout << " Error opening the file " << endl; …

Member Avatar for WaltP
0
125
Member Avatar for monere

Hello, I want to develop a video application using a tv tuner from Aver media Avertv hybrid ultra usb. I need to know how to control the tv tuner: issuing cpmmands such as " pause, read, write, record, timing command etc ". operating system : windows vista. programming language: C++ …

Member Avatar for _adam_
0
90
Member Avatar for tones1986

hey All. I am currently working on a project to create a basic student registration system using classes and other sorts of stuff later on... as of now, i am to create three classes as follows: Person, Student, and courseInfo. I have to create a simple driver program that allows …

Member Avatar for vmanes
0
271
Member Avatar for Liszt

How would it be possible to code inside a button that the Browser will open and go to address: [url]http://www.google.com[/url] private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { //Code here to go to: [url]http://www.google.com[/url] ? }

Member Avatar for MosaicFuneral
0
264
Member Avatar for shadowfire36

i was given an assignment by my prof. , but he stated that using pointer notation . the object t=of the program was to write a C++ function ReverseArray using "pointer notation" that will write out the elements of an array of int in reverse order. his comments were This …

Member Avatar for skatamatic
0
140
Member Avatar for 3pid

Hey! do you know the game snake? well my professor asked us to develop it in c++! It`s crazy!Although he said write a simple program but I`m still confused!Can someone pleassssssssse help me with it? The snake should eat and Its length and score should increase and also do not …

Member Avatar for William Hemsworth
0
102
Member Avatar for serkan sendur

can you please give me an article address which tells when to use stack and when to use heap, how to use them properly and the performance issues related to usage. Thanks

Member Avatar for serkan sendur
0
108
Member Avatar for Marija-

Hi! I have a problem to make a list of students (i know how to put all the input and to calculate the average of the students grades) but i don't know how to put the students in new list arrayed by their average form biggest to smallest and if …

Member Avatar for Narue
0
130
Member Avatar for neoangin

Hey! I am college student training for exam. Found one problem and I know you'll know what to use straight away. Here we go: We got a file where the excel sheet is encrypted like this: 1;2;3;=A2 ;;1;4;5 ;=580*A;=D2+1 Formulas are just simple ones, max. two numbers and *, /, …

Member Avatar for neoangin
0
127
Member Avatar for serkan sendur
Member Avatar for serkan sendur
0
76
Member Avatar for arun_lisieux

QUESTION: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? I was trying to solve this problem. I was previously suggested to use the "Sieve of Eratosthenes" Method to find the prime nos. [url]http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes[/url] I came up …

Member Avatar for arun_lisieux
0
288
Member Avatar for winrawr

I was just curious, besides the APIs and DLLs, etc, what is the difference between C++ compiled in windows, and C++ compiled in linux? Is it just the OS interrupts used in the machine code or what?

Member Avatar for Ancient Dragon
0
101
Member Avatar for MyRedz

hi i just done my program and the input have some digits gone from it.i don't know how to recorrect it so i will like to seek advice here please [CODE] #include <iostream> #include <cmath> using namespace std; void convert(int , int, int, int*); //convert(number, base, length, result) int len=0, …

Member Avatar for MyRedz
0
124
Member Avatar for FrancisC07

hi guys! i need help ! what's wrong of this code?? this program will input five names and will output the five names i inputed. but when i run this program and i inputed a five names. It couldn't give me the exact answer.. the output should be this: please …

Member Avatar for MyRedz
0
98
Member Avatar for mcamacho07

I'm trying to write a program that will calculate rations, max, min, total and average #. I'm told I can use #include <algorithm> but I don't know how to use it. I need it to spit out something similar to the following: How many in the first category? 8 cats …

Member Avatar for mcamacho07
0
147
Member Avatar for Corus

I was wondering if it's possible to ignore certain digits of a number, and how it would be done.It will always be a 21 digit number, and i want it to only use the last 7 digits of the number. Eg: 000J90120071000002291 is the number, and I only want it …

Member Avatar for Corus
0
176
Member Avatar for clutchkiller

Is it possible to declare something like [code=C++] string blah[51] [/code] The way I would assume this would function is that each elements of the blah array would be a string, or is this not possible? Thanks Edit: just tried this in dev c++, and it didn't give me any …

Member Avatar for clutchkiller
0
90
Member Avatar for IVantToVin

My goal is to have a vector fileList of type ofstream that I could later loop through to write the same information to each of them (copying at the end is not an option). The list of files comes from argv (processed by getopt). I understand that I need to …

Member Avatar for Agni
0
2K
Member Avatar for mps727

Hi. I am using an std::Vector and I have a question about memory allocation. I have a vector of animation objects inside my graphic object. I add new animations externally via this method: [code=c++] void Graphic::addAnimation( int* frames, AnimationStyle style, int frameCount, double updateInterval) { Animation* a = new Animation(frames, …

Member Avatar for Rashakil Fol
0
7K
Member Avatar for nickichl

Hi i'm new to C programming, and i have this homework which i need to do on compounding interest, i would like to know whats wrong. it says, "Run-Time Check Failure #3 - The variable 'HoursWorked' is being used without being initialized." same with other variables. below is my code. …

Member Avatar for nickichl
0
279
Member Avatar for TheBeast32

Hi, I was wondering how you would intercept data on a given port without interrupting it in WINSOCK. Like if computer A sent computer B "hi" on port 1337 and it was received on a server program. How could I listen for that data on computer B, but still let …

Member Avatar for TheBeast32
0
707
Member Avatar for BigJermZ

im using windows xp, and ive installed and unistalled dev C++ several times and i can not get it to work (compile and run) for any program even "hello world". even the dev c++ examples show a [linker error]. the code exactly is: [Linker error] undefined reference to `__cpu_features_init' ld …

Member Avatar for Stefano Mtangoo
0
164
Member Avatar for mini programmer

Hi I want to know some information about[COLOR="Red"] (( files ))[/COLOR] I specified two questions and I hope to answer them. [COLOR="Red"]First :[/COLOR] using function ( [I][B]read [/B][/I]and [I][B]write [/B][/I]) [CODE] fileName.write( reinterpret_cast< const char * >( & variableName ), sizeof( Ttype ) ) ; [/CODE] in binary files only …

Member Avatar for mini programmer
0
147
Member Avatar for deviantrunner

hello i just to know how to define an array... when using a variable... for example... [code=c++ ] cin >> numb; int an_array[numb] [/code] when i try it...it tells me cannot allocate an array of constant size 0 and unknown size ... so could you please tell me how do …

Member Avatar for MosaicFuneral
0
106
Member Avatar for rock9449

in C++ i am getting two errors regarding illegal else without matching if , and i have dont i myself the last step of my project is to obtain the average of all non positive numbers and average of all negative numbers as well as the sum of just the …

Member Avatar for StuXYZ
0
110

The End.