49,757 Topics

Member Avatar for
Member Avatar for arpit.mishra

Hi, I tried to direct the output from a thread into a log file using fstream, but it dosent seem to work. If I use ostream then it works fine. Can you please let me know why fstream is not working. Thanks in advance

1
243
Member Avatar for punchinello

Here's the code: [CODE]#include<iostream.h> int test(); int main() { cout<<test(); return 0; } int test() { int a=1; a==1? return 1: return 0; }[/CODE] Could anyone please help me by telling me why VC++ 6.0 rejects this piece of programming code? Is the line" a==1? return 1: return 0;" grammatically …

Member Avatar for mrnutty
0
129
Member Avatar for freddyvf
Member Avatar for mrnutty
0
71
Member Avatar for punchinello

As I was told, recursion is a good way to make things simple in terms of writing programming code, but the outcome usually involves extra overheads. I was also told that for some recursion algorithms it is possible to adapt them to make corresponding nonrecursion ones. I wonder if there's …

Member Avatar for punchinello
0
82
Member Avatar for restrictment
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> using namespace std; int main() { //delcare varialbe char selection; //declare function void counting_loop(); void impossible(); void missing_item(); void odd_even(); void poem(); void pause_m(void); do { cout << " Welcome to the Fun Program" << endl; cout << " Select from the menu " << endl ; cout …

Member Avatar for VernonDozier
0
110
Member Avatar for samsons17

i'm trying to determine the age of the people by entering their id card number..i'm trying to do this without having the database.. is this code possible??because i got error when try to run it.. if this possible,could you tell me the correct way to do this? Thanks... [CODE] #include …

Member Avatar for jonsca
0
105
Member Avatar for fadia

Hello guys.. I have this tutorial that i keep getting errors on no matter what i've tried.. Would someone kindly check it out for me?! Here is the question: [B]Q1:- Write a program that reads students’ names followed by their test score. The program should output each student’s name followed …

Member Avatar for jonsca
0
105
Member Avatar for rookanga

I am amost done with the code but I need a little bit more help I need to add the bubble sort code & write exchange increment line and add the selection sort code & write exchange increment line, but I don't know how to do it can anyone help …

Member Avatar for Fbody
0
247
Member Avatar for A Tripolation

Hey all. I'm really new to programming and would like some help, if you all don't mind ;) I'm not actually having trouble with the programming, but rather, what I'm being asked to do. Here is what I'm supposed to do (and yes, it is an assignment, but I'm only …

Member Avatar for A Tripolation
0
165
Member Avatar for freddyvf

i am using turbo c++. can you please tell me how to make two or more cpp or exe file together one.

0
87
Member Avatar for ITfav

Hey guys, i'm confused... wat's e diff btn [B][COLOR="Green"]LPD3DXMESH [/COLOR][/B]and [B][COLOR="green"]ID3DXMesh[/COLOR][/B]? Including their uses and so forth... help me understand e diff. Ok, i'm learning Direct X 9. Thx in advance! :icon_smile:

Member Avatar for ITfav
0
140
Member Avatar for tomtetlaw

When I try to compile this: [code=c++] void *BaseEnt::GetVar(char const *varname) { char name = *varname; switch(name) { case "id": return (void*)id; case "name": return (void*)name; case "count": return (void*)count; default: return (void*)NULL; } } [/code] I get these errors: [code] ------ Build started: Project: Test Classes, Configuration: Debug Win32 …

Member Avatar for slackingjuggalo
0
710
Member Avatar for nevets04

Why are there so many people doing c++. I've heard even from c++ coders, that python is better. Is this maybe because c++ has been around longer? What do you think the future of python is? Do you think It will eventually beat out c++?

Member Avatar for jbennet
0
225
Member Avatar for JaBa

Hi! I make c++ programm for school and I have problem with array rotation for 90 degree. I make array rotation from one example, but there is an array rotation on wrong way, I need to make it to rotate to other way. So please help me. Here is code: …

Member Avatar for Clinton Portis
0
107
Member Avatar for nateysmith

[CODE]#include <iostream> using namespace std; int main() { int TESTS = 0; int testScore[TESTS]; int testNum = 0; int a; double total = 0; double average; testNum = 0; cout<<"How many scores are there? "; cin >> TESTS; cout<<"Enter a score: "; cin >> testScore[testNum]; while(testNum < TESTS && testScore[testNum]) …

Member Avatar for nateysmith
0
2K
Member Avatar for xxunknown321

Write a C++ program that ask the user for the name of a file. The program must have a function that prompt the user to enter a file name and open the file. The program should display the last ten lines of the file on the screen. Each line of …

Member Avatar for xxunknown321
0
184
Member Avatar for gcardonav

Hi guys: The following code is supposed to the following: 1 - Receive a random number and divide the number by 1000 2 - Then it needs to check if the number is greater than the series number and the cut point and convert the divided random number to either …

Member Avatar for VernonDozier
0
135
Member Avatar for NinjaLink

My question is, how do you calculate the "Completion Time" as I am alittle confused about it. Do I add the service times and the result is the completion times? Thank you to anyone who helps Jobs --- Service Time -- Arrival Time -- Wait Time J1 --- 2 --- …

0
51
Member Avatar for manoj.pg

If I have the class name in a string varibale, how can I instantiate an object of that class? I am just thinking of COM and CORBA implementations where C++ object is instantiated from the data in the stream. How can I implement it?

Member Avatar for mrnutty
0
677
Member Avatar for jessicamelillo

Hi! I'm currently taking a computer programming course at Wagner college and I have a project due this week that I am completely stumped on. these are the guidelines: [I]This will be a something like a “compatibility program”. 1) You will ask the user their name, and store it. 2) …

Member Avatar for jonsca
0
102
Member Avatar for ArvindRaja

Recently, I stumbled across WinBGIm and decided to resurrect a small game I had made in turbo C++ a long time ago. Anyways, I succesfully got WinBGIm, did the necessary steps. After removing all the errors and building the project in Visual Studio 2008 Professional, I get this error (with …

Member Avatar for md37
0
212
Member Avatar for AdRock

I have got an example for cplusplus.com for converting a string into a char array so i can split in into tokens and adds to a vector and it works fine in the main method but if i try and create a separate function and pass a string as a …

Member Avatar for iamthwee
0
743
Member Avatar for sfrider0

I'm drawing a sphere and some ground. I used GL_POLYGON to draw a rectangle and colored it green. When I added a sphere, my ground just turned black. Is this because the sphere is a 3d object and the polygon is 2d or is there something else? Here is the …

Member Avatar for sfrider0
0
159
Member Avatar for mar000m

please if any one can help me ....i need a radix sort code for names..... all the names are data members in (node class) i just cant write the code so if any one can help me .....

Member Avatar for dibilasd
0
96
Member Avatar for ching
Member Avatar for RajNOX

[CODE] D:/Documents/NetBeansProjects/cap/main.cpp:33: undefined reference to `_imp__pthread_create' D:/Documents/NetBeansProjects/cap/main.cpp:34: undefined reference to `_imp__pthread_create' D:/Documents/NetBeansProjects/cap/main.cpp:35: undefined reference to `_imp__pthread_join' D:/Documents/NetBeansProjects/cap/main.cpp:36: undefined reference to `_imp__pthread_join' build/Debug/MinGW-Windows/main.o: In function `Z8cancelerPv': D:/Documents/NetBeansProjects/cap/main.cpp:47: undefined reference to `_imp__pthread_kill' D:/Documents/NetBeansProjects/cap/main.cpp:48: undefined reference to `_imp__pthread_exit' D:/Documents/NetBeansProjects/cap/main.cpp:51: undefined reference to `_imp__pthread_exit' [/CODE] this is the error i got when i compile …

Member Avatar for RajNOX
0
789
Member Avatar for bigsurya

Can I have a FOR Loop of in the following manner:[for(int i=0;(s[i]!='\0')|| s[i]!=' ';i++)][/CODE=C++] where 's' is a character array

Member Avatar for bigsurya
0
115
Member Avatar for mcap61

Hey guys, I'm trying to write something to a .txt file from within my program using ofstream. I have this function names show_results() which is a bunch of cout statements that are connected to a class and a bunch of member functions. But the function show_results is all cout statements. …

Member Avatar for jonsca
0
92
Member Avatar for samsons17

I dont know whats wrong with my code.. when i entered the value,there was nothing appeared on my screen.. I've tried put the single quote like this one : case '1' : cout<<Very Acidic; break; ..but it was only works for the acidic value..When i entered the value more than …

Member Avatar for samsons17
0
83

The End.