49,761 Topics

Member Avatar for
Member Avatar for AnujSuper9

Hello everyone, I'm working on a small assignment where I am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without using any built-in functions, and where the returned value is allocated on behalf of the caller. Value being the integer to convert, and base …

Member Avatar for AnujSuper9
0
3K
Member Avatar for Freezeskier

Ok so hers the deal im in a programming class and i am attempting to solve this problem but i have no idea how to go at it really. Its due tomorrow and i had no Idea where else to go. Thanks in advance. Write analysis program to read the …

Member Avatar for VernonDozier
0
178
Member Avatar for SallyJ

Hi I'm new to C++ and need help urgently. I need a C++ program that converts letters into ASCII numbers. For example if I enter a name James Bond the output would be 66 and 74 Thanks SallyJ

Member Avatar for VernonDozier
0
80
Member Avatar for hurbano

hi i need help writing a program that will read in input file containing c++ code and then checks for grouping matching symbols like { } ,[ ] ,and ( ). if there is a mismatch symbol in the input file the the program will read and recognize the error. …

Member Avatar for nucleon
0
143
Member Avatar for jesseb07

hey, I got a question regarding functions returning a linked list. Here's the data structure of my linked list (just in case it deviates from the standard way of doing it) [CODE] template <class T> class Link { private: unsigned int size; Link<T> *nextRow; Cell<T> *firstCell; public: Link(); ~Link(); //functions …

Member Avatar for jesseb07
0
103
Member Avatar for paolomontero

Provided the following template: [code=cplusplus] template <class T> class MyTemplate { private: T myData; public: MyTemplate(const T &data) : myData(data) {} bool Contains(const T &); }; [/code] Is there a way to ensure at compile time that the argument T derives from another class? I want T to derive from …

Member Avatar for paolomontero
0
189
Member Avatar for mimis

Hello, Can you help me to install the gtk library in Dev c++. I have installed it in Linux but i dont know how to install it in Windows. Thanks in advance.

Member Avatar for siddhant3s
0
98
Member Avatar for xVent

Hi guys , after finishing my text based game , when i send the executable file to my friend he cannot open it .. he get an error that smth is wrong in configs file .. he also has framework installed

Member Avatar for Ancient Dragon
0
122
Member Avatar for pom9x

how do i get a user input string for file input/upload to work? [CODE] int main() { string P = ""; cout << "Input Directery Example: \" C:\\Users\\mugen\\Desktop\\data.txt \" " << endl; getline(cin, P); ofstream fileOut(P); //does not seem to read string "P" how do i get it to work …

Member Avatar for ArkM
1
157
Member Avatar for Akis2000

Problem Description My pi is an irrational number, i.e. it cannot be written as a fraction. It's approximate value of p is 3:141592653589793. Below are 5 di erent series which can be used to approximate p: 1. P= 4(1-(1/3)+(1/5)-(1/7)+(1/9)-... 2. P= sqrt(12(1- (1/4)+(1/9)-(1/16)+(1/25)-...)) 3. P= sqrt(6 (1+ (1/4)+(1/9)+(1/16)+(1/25)+...)) 4. P= …

Member Avatar for Akis2000
0
207
Member Avatar for AutoC

Hi, Here's my code [code] #include<iostream> #include<fstream> #include<string.h> #include<math.h> #include<stdlib.h> #include<stdio.h> using namespace std; int cIndex(char *x,char **featlist,int len) { int i; for(i=0;i<len;i++) if(strcmp(x,featlist[i])==0) return i; } int main(int argc,char *argv[]) { std::ifstream featFile(argv[1],ios::in); std::ifstream trainFile(argv[2],ios::in); // std::ofstream svmFile(argv[3],ios::out); char line[20000]; char feat[100]; char **featlist; int i=0,len=0,fl=0,j; char* x; int …

Member Avatar for AutoC
0
142
Member Avatar for kaseem724

hi, i am pretty new at using c++. i am trying to read a mathematical expression from a file but i keep getting errors. i am using the cin.get function to read it but it isnt working. can anyone help me please. this is what i have. the file being …

Member Avatar for tux4life
0
2K
Member Avatar for arshad115

hi,i m making a windows forms application and i want to make a treeview which displays input of textbox Under the Parent Node . i have tried searching over the internet,but nothing seems to be working. i have added the parent nodes from the properties tab,but how do i change …

Member Avatar for arshad115
0
195
Member Avatar for pczafer

I`m trying to to use if statement but something going wrong. statement must be 2 steps IF There is still room in the array and IF there is not an Appointmen on the same Date and Time! Apointment will be accept...... im not getting any error or worning but its …

Member Avatar for pczafer
0
141
Member Avatar for aksshe10

i have created an exe which shows a message but the problem is i want to create another program from which a person can enter his name, choose destination and click create after clicking create a new exe if made in the location he chose which has the name he …

Member Avatar for aksshe10
0
182
Member Avatar for kvprajapati

Hi, Following code snippet show the maximum number of nodes to be created. I execute this code and show the count : 7874 My problem is that I want to create more node than 7874. I have compiled this code by Turboc version 3.0 on Windows XP. [CODE]#include <stdio.h> #include …

Member Avatar for John A
0
164
Member Avatar for ankit894u

[code=cplusplus]#include <iostream> #include <fstream> using namespace std; void PrintError(fstream&, char, bool&); int Conversion(fstream&, char&, bool&); int main() { fstream InFile; char Bit; int Decimal; bool BadBit = false; //Open file to read InFile.open("f:\\Binary.txt",ios::in); //Read the first bit of the number InFile.get(Bit); //continue reading all numbers till the end of file …

Member Avatar for ankit894u
0
115
Member Avatar for Clockowl

Hey guys, How would I partially specilize a template in a manner as below? Is that even possible? I have these two functions: [code=cpp] bool node::read(const char *filename) { ifstream f(filename); if (!f.good()) return false; bool success = read(f); f.close(); return success; } bool node::write(const char *filename) { ofstream f(filename); …

Member Avatar for Clockowl
0
508
Member Avatar for abhi_iips

hi all, i have created a class names members which looks like this.. class mymembers{ int data; float dummy; char* thename; public : mymembers() { cout<<"the value of i is "<<data; data =12; } mymembers(int ic,char* name) { thename = name; data= ic; cout<<"hello this object's data value is "<<data<<endl; …

Member Avatar for ArkM
0
112
Member Avatar for Xamas

Well, I don't want to do lot of copy-paste in my code, so, I'm just wondering - is it possible to have two different names of one functions(I prefer that function name describe what is used for): ex: [CODE]int do_my_client(int info) { blah blah blah; .... .... return inf; } …

Member Avatar for ArkM
0
105
Member Avatar for Peyton

Hi there, I am having a problem with the following code: [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; int findRows( string line ); int main() { string line; int rows = findRows( line ); cout << "Number of rows: " << rows << endl; } int findRows( string …

Member Avatar for Peyton
0
156
Member Avatar for ks7_666

Question 1: Write a program that reads repeatedly 3 integers a, b, and c and test if they are Pythagorean triples. Whether or not . Your program should keep reading in triples until all three values entered are zero. When The user enters three zeroes, it should exit without printing …

Member Avatar for jephthah
0
312
Member Avatar for lifted

Hello, i'm very new to c++ and i'm trying to create some sql but dont really know how. i need a very simple query in php i would do something like: [CODE] $page = "pagedata"; $sql = "INSERT INTO data SET field = '$page'"; [/CODE] i know i cant do …

Member Avatar for lifted
0
155
Member Avatar for xVent

Hello guys , i created a text based RPG , now how can i save what the player did before he exit? for example , he have killed some monsters , gained exp .. i need to save the exp , his name when he start a new character , …

Member Avatar for xVent
0
82
Member Avatar for IrvineKinneas50

I'm implementing dijkstra's algorithm, and I'm implementing it using a priority queue so that the shortest distance is on top for fast access. The priority queue uses a vector for its operations. Each node has the following properties: int id int dist Node *path Here is the issue: when I …

Member Avatar for siddhant3s
0
91
Member Avatar for rEhSi_123

Hello Everybody, Need abit of help in my code: Basically I have two forms, namely form1 for Login and form2 is the actual application. The first issue I had was hiding the form1(login-screen) after a successful login which I was able to do by declaring [code=c++] Hide(); [/code] Now the …

Member Avatar for rEhSi_123
0
142
Member Avatar for lifted

Hello everyone, first little explanation about what i want my program to do: i use wget to download a webpage but instead of downloading it into a file i want the webpage sourcecode in a variable so that i can parse it and put it in a database later. Now …

Member Avatar for lifted
0
175
Member Avatar for drjay1627

I doing this server and client program. The sever has to output to the client. [code] strcpy ( outBuf, " " ); sprintf ( outBuf, "cylinder: %d Sector: %d\n", cylinders, sectors ); if ( write ( client_sockfd, outBuf, strlen ( outBuf ) + 1 ) < 0 ) { perror …

Member Avatar for drjay1627
0
100
Member Avatar for vaps

Hi! I'm making an inventory managment system, but i need User Authentication, to login users, and controle there Type, like admin, guest or normal users. I want to do it with .CSV files, because the rest of my program is witch CSV files. Does anyone have a sample code, for …

Member Avatar for tux4life
0
113
Member Avatar for jaeSun

ok, I am needing to calculate powers in C++ (ie, 10^6, 10^9, 10^101, etc) the pow function uses double, and after 10^5, returns a number like (8e3245) ... but i need it for larger powers ... now, is there a function I can do that will break it down somehow? …

Member Avatar for tux4life
0
2K

The End.