51,593 Topics

Member Avatar for
Member Avatar for dude1

i need to make a program that reads in a file and list things like the number of characters,words lines spaces tabs etc. anyone know the best way to do this? any help anyone can provide is appreciated thanks

Member Avatar for WaltP
0
100
Member Avatar for kavithabhaskar

Hi I am trying to count the number of words in a file and this is what i have so far. I am not sure about the getchar().. could you please tell me what i should be doing ? [code] #include<iostream> #include<fstream> #include<string> #include<conio.h> using namespace std; int main() { …

Member Avatar for necrolin
0
267
Member Avatar for caribedude

Hi, I seem to be getting myself into a lot of segmentation fault errors lately. The that currently has me stuck is one that shows up after I exit my program (an SDL App). When I need to debug I usually use the debugger or a Logger class I found …

Member Avatar for caribedude
0
253
Member Avatar for amia

write a c program that finds the smallest number among the five integers inputted by the user with the given sample output: Enter first number:20 Enter second number:3 Enter third number:18 Enter fourth number:100 Enter fifth number:7 The smallest number is 3...

Member Avatar for jonsca
0
44
Member Avatar for faaz

I have this homework assignment that i need help with and below is the code that i have so far. any help would be appreciated. thank you. Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. For example, …

Member Avatar for restrictment
0
773
Member Avatar for karolik

So I'm trying to find a way to basically generate 100 numbers from 0 to 99 in random order with no duplicates. This is my code, and as you can see it displays 100 numbers but....some are duplicates. [CODE] srand((unsigned)time(0)); for (int count = 0; count < 100; count++) { …

Member Avatar for jonsca
0
118
Member Avatar for PDB1982

I am trying to start the odometer reading at 0 to start with, but I want it to increase everytime the user inputs MilesDriven. I can't seem to get it to work...any ideas? [code] //Paul Baker //TRCC Intermediate C++ //Assignment 3, Odometer #include <iostream> using namespace std; class Odometer { …

Member Avatar for PDB1982
0
95
Member Avatar for clutchkiller

[code] #include <iostream> using namespace std; class A { private: int a; }; A::A() { a = 10; } int main() { A obj1; cin.ignore(); cin.get(); } [/code] It is giving me the error Error 1 error C2600: 'A::A' : cannot define a compiler-generated special member function (must be declared …

Member Avatar for mrnutty
0
142
Member Avatar for suncica2222

[CODE] _CreateProcess __CreateProcess = NULL; __CreateProcess = (_CreateProcess)GetProcAddress(GetModuleHandle("Kernel32.dll"), "CreateProcessA"); [/CODE] what is this (_CreateProcess) in the code??? is this a cast types? __CreateProcess = [B][COLOR="Red"](_CreateProcess)[/COLOR][/B]GetProcAddress(GetModuleHandle("Kernel32.dll"), "CreateProcessA");

Member Avatar for WaltP
0
91
Member Avatar for atticusr5

hey everyone so for my class in c++ we were asked to implement a linked list in an old program. in the old code i had two classes, and the point of the new code was to take the old code and implement a linked list. I honestly have no …

0
53
Member Avatar for cj_in da house

can anyone explain what this part of the for loop is doing? [code] int findMode(int *array, int size) { int mode = -1, position = 0, highest; int frequency[constant]; for(int i = 0; i < size; i++) //initailize all frequencies to 0 *(frequency + i) = 0; for (int k …

0
41
Member Avatar for Morrac

I am creating a C program to work with environment variables and I am having some problems. I have three choices to input from the command line: a.exe, a.exe <environment_variable_name>, or a.exe -a. The 'a.exe -a' should display a list containing all environment variable names and assigned values, with one …

Member Avatar for Morrac
0
113
Member Avatar for Martje

Hi all, I am trying to write a string to a multiline textbox but apearently my code doesnt do as i want... This is the code i am using : [CODE]textBox9>Lines[0]="Succes";[/CODE] But when the code executes nothing happens in the textbox, everything just stays thesame :S Am i doing something …

Member Avatar for Martje
0
433
Member Avatar for minnu09

HI, i was trying to develop a project in VC++. I am having my source code(my *.cpp and *.rc files) in a directory called "srce" and the header files in a directory "inc" and the resources in "res". now when im trying to compile the project its giving me an …

0
39
Member Avatar for Kakespade

I've just started learning C++, and I'm having some problems running my programs. Even when I just copy the source code from my C++ tutorial book: [CODE]//----------------------------------------------------- // // add.cpp // // Program for adding two whole numbers // #include <iostream> using namespace std; int main () { int number1; …

Member Avatar for NathanOliver
1
141
Member Avatar for Dyed Purple

Hiya. I'm a complete C++ noob. I'm trying to make a bingo game where the computer gives the user eight numbers and the user slowly plays a game of bingo. It's very much work in progress. However, I'm having a problem when trying to compile it, the program seems to …

Member Avatar for Dyed Purple
0
131
Member Avatar for deepaknegi777
Member Avatar for i_luv_c++

hey guys im working on a homework problem..im done with 99% of the problem :|however i cnt figure out how to display my output(which is in dollars) using the comma my output shows >>160000 how would i make it >>160,000 um should i use setprecision??? please help thanks:)

Member Avatar for i_luv_c++
0
163
Member Avatar for newcmp

Hey, i've just joined...having trouble with a vector question.. the question asks that if a you a range of numbers, eg.6, we want to erase every third number: eg. 123456 12456 1245 125 15 1 and out we get should be as in this case 1. so far what i …

Member Avatar for Ancient Dragon
-1
89
Member Avatar for miles.85

I will start a new project. But I have some simple questions about it : 1) Is the C faster than Java on processes which has no graphic user interfaces (like softwares which are working just from command line) ? 2)Because if the C is faster than Java, I want …

Member Avatar for miles.85
0
221
Member Avatar for tom384

Hi folks, First a bit of context (Errors are shown at the bottom of the post): I am creating an object viewer for opengl in Visual C++ 2008 Express Edition. I have written a parser which reads the file and stores all the info I want in a Mesh object. …

Member Avatar for tom384
0
358
Member Avatar for Dabareah

Hey everyone, I need help in figuring out how to make this program work. I am attempting to reverse this TraverseList. Yet I am still encountering issues when I compile. I am hoping that someone might assist me in re-creatin the program so that it goes forward. Anxiously waiting!! Please …

Member Avatar for Ancient Dragon
0
70
Member Avatar for kavourdoukos

I've got this: [CODE]#include <iostream> #include <vector> #include <string> #include <cstdlib> #include <sstream> using namespace std; class alfa{ private: int x; public: alfa(){ cout<<"Dimiourgithike ena alfa"<<endl; x=rand()%10; } ~alfa(){ cout<<"Katastrafike ena alfa"<<endl; } void get_x(){ cout<<"To x exei timi: "<<x<<endl; } }; int main(){ alfa* alfadi; int no; cout<<"Dose enan …

Member Avatar for mitrmkar
0
98
Member Avatar for techie929

How to find number of total child(including grand children also) nodes for a particular node in a bst using C++. Could anyone please suggest me method of doing it. Thanks.

Member Avatar for WaltP
0
40
Member Avatar for cwarn23

Hi and I am making a script but am having a slight math logic problem. Below is an example of an encoder I am working on. [CODE]for(int m=0;m<80;m++) { if(m<=19) { f = (b & c) | ((~b) & d); k = 0x5A827999; } else if(m<=39) { f = b …

Member Avatar for cwarn23
0
120
Member Avatar for SCoder1

Would it be possible to code an IP Tracer strictly for experimentation purposes? I was just wondering I know a c++ so I was just wondering if it could be done like in VC++ or win32.

Member Avatar for Salem
0
60
Member Avatar for theABCasian
Member Avatar for Zcool31

Hello everyone. I am trying to write an application that uses OpenGL (with GLFW) for graphics. It is meant to be as portable as possible, and I try not to have direct interface with platform specific things other than through GLFW (I can also use SDL). The problem is that …

Member Avatar for Zcool31
0
204
Member Avatar for techie929

[CODE] //This is what we are asked to print in the assignment of Binary Search Trees.The Nodes are printed like: F +-- D | +-- NULL | \-- NULL \-- R +-- P | +-- M | | +-- NULL | | \-- N | | +-- NULL | | …

Member Avatar for techie929
0
80
Member Avatar for rwill357

I am new to binary trees. I have been given the task to write functions to count the number of nodes, to count the number of leaves in nodes, to count the number of right children, to find the height of the tree, and to delete all the leaves of …

Member Avatar for WaltP
0
171
Member Avatar for 140chris140

Hey, I have no idea if this thread already exists. I did try to make one before but it seemse like it didn't work. So here goes ! My question is - How do I put my .o files into an object library file? I'm using c++ visual studio express …

Member Avatar for 140chris140
0
534
Member Avatar for corby

pretty much where i have many of my comments are where i need to call the functions from the player and cell class in the tictactoe class? anyone have any ideas on how to do this? [CODE]#include <iostream> #include <cstdlib> using namespace std; class TicTacToe { public: TicTacToe()//contructor initializes the …

Member Avatar for WargRider
0
677
Member Avatar for intervade

So I'm working on a linked list class, for a class I'm taking. I've basically just started working on it and I'm getting an unknown error that I really don't know how to deal with. The compiler is not returning an error in my code really, its returning a bunch …

Member Avatar for mitrmkar
0
153
Member Avatar for gajji2020

Hi i have weird doubt. My assingment is C++ program to insert and delete elements in Binary Search Tree.I am almost done wid the assingment. But the major part lies here. the strucure of the output is difficult to obtain.. i will explzin the question now. Input: F D R …

Member Avatar for WaltP
-2
137
Member Avatar for valeriy_zf

I'm confused totally... Ok, I create the class with the array: [CODE]ref class my_child { public: array<int>^ mas_1D; my_child() // constructor { mas_1D = gcnew array<int>(10); }; };[/CODE] Next, I create one more class with the variables of the previous class: [CODE]ref class Father { public: my_child dear_baby; // 1-st …

Member Avatar for valeriy_zf
0
152
Member Avatar for sonai4u

Hi, I need one of my assignments to be done in C or C+. Need someone who can do the assignment for it. Need it urgently..need the assignment done by sunday. Will pay money for doing the assignment. Please email me immediately <<Email Snipped>> thanks Raj

Member Avatar for Ancient Dragon
-7
498
Member Avatar for Kirielson

I'm having Buss Error issues. I feel that it has to do with either my deconstuctor or my insert/delete functions. I know I'm not supposed to put up whole source code, but I will put it up if needed. Assume that ItemType is an integer and Next is a pointer. …

Member Avatar for Kirielson
0
119
Member Avatar for wwsoft

hello my question is, How do you sort a vector containing a bunch of game_object* 's ? You can use STD's algorithm.sort() somehow ... right ?

Member Avatar for mitrmkar
0
105
Member Avatar for techie929

Hi, Could anyone please tell me how can i input data either from a file or stdin. If the file name is not specified the data can be read from the UNIX command prompt using stdin. I know stdin is a file pointer but how to use it please explain??

Member Avatar for Duoas
0
592
Member Avatar for suncica2222

I need start up function that will make registry entries and make my .exe app start with the windows start up.Where can I find code for such function?

Member Avatar for suncica2222
0
127
Member Avatar for angel6969

write a definition of a class named Point that might be used to store and manipulate the location of a point in the plane. a. A member function set that sets the private data after an object of this class is created. b. A member function to move the point …

Member Avatar for vmanes
0
99
Member Avatar for CppBuilder2006

temporaries: Definition: a temporary is a C++ object which is niether a constant nor a variable, but is has type. example1: [CODE]TYPE f(int a) {...}[/CODE] f(2) is a temporary. it is niether a constant nor a variable but it has a type. example2: [CODE] class A { public: A(char ch) …

Member Avatar for CppBuilder2006
0
277
Member Avatar for angel6969

Create a temperature class that internally stores a temperature in degrees Kelvin. However, create functions named setTempKelvin, setTempFahrenheit, setTempCelcius that takes input temperature in the specified scale, converts the temperature to kelvin, and stores that temperature in the class member variable. Also, create functions that return the stored temperature in …

Member Avatar for Fbody
0
2K
Member Avatar for tetron

There is probably a joke in the comment that I am missing but this post is going to give the design approaches to solving the problem posed by FirstPerson in his signature: find the last ten digits of x^x (x raised to the power of x) for all the positive …

Member Avatar for mrnutty
0
295
Member Avatar for MrYrm

Hi all, As a learning project I'm rewriting a spider i have in php to c++. One part of the spider is a multi-threaded downloader, all this downloader does is read urls from a text file download the page and save it. I would like the downloader to strip out …

Member Avatar for MrYrm
0
84
Member Avatar for Aliun

So, this is my version of battleship with single space ships instead of a ship with 2,3,4, and 5. The only issue is the cpu I programmed isn't always choosing five, or it's choosing spots not on the map, I am completely lost if you can offer any help at …

Member Avatar for Aliun
0
1,000
Member Avatar for aswin cp

Ive been told to do a program that prints the first [B]15 non-fibonacci series[/B] using 'while'...i got the fibonacci series correct, but cant find a solution for this... Here is my code for printing the first 15 fibonacci series... [CODE]#include<iostream.h> #include<conio.h> void main() { int n=1; int a=-1; int b=1; …

Member Avatar for mrnutty
0
1K
Member Avatar for martin_dore

Here is my problem. I have a class Template define like this. [CODE]// File Vecteur.h template<class Elem> class Vecteur : public AdenEtEve { public : ... BOOL bInserer (Elem &elemAInserer, MOT32 wIndice);` ... protected: Elem elem; Elem *pElem; MOT32 wNbElem; } template<class Elem> BOOL Vecteur<Elem>::bInserer (Elem &elemAInserer, MOT32 wIndice) { …

Member Avatar for martin_dore
0
108
Member Avatar for kilon666

I'm working on a program to write chemical reactions a certain way from a file, calculate the mass and check whether they are conserved. I have this code so far: [CODE]#include <iostream> #include <fstream> #include <string> #include <sstream> using namespace std; #define INDEX_H 0 #define INDEX_B 1 #define INDEX_C 2 …

Member Avatar for kilon666
0
113
Member Avatar for bori02082009

For example, if I have the number 142, how do I know it contains the digit 1, 4, and 2? So far, I've worked out that 142/100 =[B] 1[/B] 142 - (1*100) = 42 42/10 = [B]4[/B] 42 - (4*10) = [B]2[/B] So i can just use a looping system. …

Member Avatar for abdelhakeem
0
166

The End.