49,761 Topics

Member Avatar for
Member Avatar for defender_

i am writing a program with threads. it's a simple program in which user will enter how many number of thread he want to be created. what technique we use to create multiple threads ?? using for loop ??? suppose to run 3 threads... [code=c++] for(c=0; c<3; c++ ){ pthread_create(&thread[c], …

Member Avatar for kvprajapati
0
88
Member Avatar for hiscasio

Design an Employee Information System for employees of Super Shoppy The employee master should keep employee specific information. For each employee, details of all dependent family members are also maintained. There may be one or more family members for an employee. The menu base program should provide following options…  …

Member Avatar for hawash
0
144
Member Avatar for Peyton

Hi there, I have been trying to figure out the common recursion problem given in e.g. 6.42 in the following link: [URL="http://net.pku.edu.cn/~course/cs101/resource/CppHowToProgram/5e/html/ch06lev1sec28.html"]Towers of Hanoi[/URL]. After a few hours I still can't figure it out, even though I've got the code: [CODE=cplusplus]#include <iostream> using namespace std; // num disks void Towers(int …

Member Avatar for csurfer
0
124
Member Avatar for catchmrbharath

I was trying to find the number of zeroes in a factorial of a number. The time limit was 2 sec. Max number of test cases being 100000 my code is as follows [code=cpp] #include<iostream> #include<cstdio> int five(int number); int two(int number); using namespace std; main() { int num; int …

Member Avatar for Sky Diploma
0
142
Member Avatar for rajboy

Hi there, Ive just started out learning C++ and ive been thrown 3 qns and ive got no clue how to start working on them.Im not here for the codes but rather someone could spur me up so that i can kickstart. First of all, i need someone to recommend …

Member Avatar for ithelp
0
97
Member Avatar for Traicey
Member Avatar for MosaicFuneral
0
149
Member Avatar for keripix

guyz, im having problem programming with UNO. when i include the header, such as [code]#include <com/sun/star/bridge/XUnoUrlResolver.hpp>[/code] i get "no such file or directory" im new to this. Is there any things i must set first? ive already run the setsdkenv_unix.sh. Oh ya, im using openSuse. So any advice on what …

Member Avatar for keripix
0
43
Member Avatar for s_sridhar

I'm not quite familiar with Visual C++. I was trying to create a basic win32 program. I compiled it but i don't know how to run the output file. If i select start without debugging, it asks me to choose the executable file. But i don't know what to do …

Member Avatar for s_sridhar
0
113
Member Avatar for cmick56

I am having trouble figuring out how to write the following code and having the the two void functions? I am supposed to pass the values of the integer array to the functions using the call by reference method. here is the code i have so far. [code=cplusplus] include <iostream> …

Member Avatar for Ancient Dragon
0
139
Member Avatar for boiishuvo

option_3(): >>cin >> studentID[actualNum]; is actually working though :S I've tested it and it works fine. The code marked in red is supposed to be just an average, but the thing is I have no idea how to sum (add) the studentMark then display the total of all students' marks. …

0
80
Member Avatar for imaloner

I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working, commercially sold application with only partial build instructions. The previous maintainer of the code (a mixture of C and C++) …

Member Avatar for JasonHippy
0
760
Member Avatar for imaloner

I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working, commercially sold application with only partial build instructions. The previous maintainer of the code (a mixture of C and C++) …

Member Avatar for imaloner
0
776
Member Avatar for Xephys

Hi there, This is my first post and I am quite new to developing games. I have only made tic tac toe and currently making a pong clone, using c++ and SDL. I seem to be having a problem with the animation of my ball (or puk as I call …

Member Avatar for Xephys
1
226
Member Avatar for san gabriel

output should like that: input #: (909)869-2511 area code: (909) exchange: 869 ext.: 2511 telephone #: (909)869-2511 this is my code so far: [code=cplusplus] #include "stdafx.h" #include <iostream> #include <iomanip> #include <cstring> using std::strtok; using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char sentence[32]; char *tokenPtr; tokenPtr = &sentence; …

Member Avatar for siddhant3s
0
166
Member Avatar for lexusdominus

Hello! google has turned me up at this forum so many times i think it would be stupid to ignore the hints & not get registered! Im having some problems with objects. Here is my code: [CODE]#include <iostream> #include <string> using namespace std; class planet{ public: int moons; int mass; …

Member Avatar for lexusdominus
0
139
Member Avatar for Motiranjan

HI, I need some quidance how to practice vc++ to attend some interview. What are the main topics I have to cover. Thanks Motiranjan <snip email>

Member Avatar for Motiranjan
0
81
Member Avatar for allsey_1987

hey all, i'm working on a very simplistic example to revive my cpp skills for an up coming work placement. however i'm running into what seems an inconsistant error using ostream (cout)... have a look at the following code in the main()... :: main.cpp :: [code=CPLUSPLUS] #include <iostream> #include "IntArray.h" …

Member Avatar for allsey_1987
0
84
Member Avatar for Chumpcash

Hey, I really need some help fixing the errors in this source file! I honestly don't know how to fix some of the errors. This assignment has to be submitted it 2 days. I've looked for the missing sytax errors and the other ones but i just cant seem to …

Member Avatar for Yiuca
0
165
Member Avatar for mathueie
Member Avatar for MosaicFuneral
0
48
Member Avatar for Clawsy

Hello, I just started reading and learning DirectX SDK's tutorials in order to develop skills for game programming. I don't know COM very well (i just start learning it). I read lights, materials, mesh and BasicHLSL DirectX9 tutorials (line by line). I know C++ and math (not VERY good math …

Member Avatar for Stinomus
0
363
Member Avatar for clutchkiller

Is it possible to open a file in binary mode and make an array out of it then to encrypt that information. I guess I should ask how you would start something like that? Thanks

Member Avatar for ArkM
0
144
Member Avatar for Heli

Hi, I'm currently trying to create a linked list to use with a BSP Tree, however the root node keeps on losing its' values as soon as I leave the function. The code is quite extensive, so I'll try to post the relevant sections. This is the header file. [b]OpenGLView.h[/b] …

Member Avatar for Stinomus
0
115
Member Avatar for jondsam

[code=cpp]#include <iostream> using namespace std; int Main() { int i = k + 1; cout <<i ++ << << endl; int i = 1; cout << i++ << << end1; return 0; } [/code] Please help me? What is wrong with this code? I am a C++ Noob! I just …

Member Avatar for lexusdominus
0
111
Member Avatar for Curtain51

I'm having a bit of trouble with this one, the goal of this program is to enter in 1 to 5 numbers, with a maximum of 5, into a vector and then popping as many numbers as the user wants until the vector contains nothing. My problem is that I …

Member Avatar for Curtain51
0
123
Member Avatar for meb111

Okay i am apparently having problems on understanding exactly how string works. The problem im having is I get an error at the part where it assigns the cards. Please help me! Much appreciated! [code] #include "stdafx.h" #include <string> #include <time.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { …

Member Avatar for ArkM
1
93
Member Avatar for sharkattack85

[code=cpp]#include <iostream> using namespace std; int main() { int length; length = 7; cout << "The length is " << length; return 0; } [/code] When i run the program, it outputs everything but the screen comes on real fast and then closes and i cant get it to stay …

Member Avatar for siddhant3s
0
242
Member Avatar for Leila1
Member Avatar for Leila1
-1
445
Member Avatar for CppFTW

Hi, why doesn't this code work: [CODE]int main() { cout << "Hi!\n"; #ifdef DEBUG cout << "I'm in debug mode!\n"; #endif return 0; }[/CODE] I am trying to make the message "I'm in debug mode!" only print when I am in debug mode for my IDE (Visual C++). But also, …

Member Avatar for CppFTW
0
260
Member Avatar for mduncan8

I have a C++ program that uses udp to send data to a VB 6 program that is running on the same computer. The VB program requests data from the C++ program. It works but occasionally the VB program throws an error. The error is: "The connection has been reset …

0
69
Member Avatar for CppFTW

Hi, why isn't this code is copying the file a.txt correctly? [CODE]int main() { ifstream input("C://Users//Me//Desktop//a.txt"); input.seekg (0, ios::end); int length = input.tellg(); input.seekg (0, ios::beg); while(true) { char* buffer = new char[length]; input.read(buffer, length); ofstream output("C://Users//Me//Desktop//b.txt"); output.write(buffer, length); break; } return 0; }[/CODE] I attached a.txt and b.txt in …

Member Avatar for CppFTW
0
144

The End.