49,755 Topics

Member Avatar for
Member Avatar for Dasini

Hi. Im a newb programmer. I m wondering... 1.what exactly is an api. I cant seen to find a clear answer 2. How do i use them in c++

Member Avatar for griswolf
0
2K
Member Avatar for hawita

Hi i am writing a program to compute the smallest number divisible by each of the numbers 1 to 20. This is what i have so far but it does not cout anything. it just gives me a blank page. Could anyone please help [CODE]#include<iostream.h> #include<math.h> bool div(ull y) { …

Member Avatar for StuXYZ
0
88
Member Avatar for Khoanyneosr

Hey, so im creating a work example for school and right now i'm working on an "address book" sort of. I have three options the user can select add, view, and delete contacts. I want the "view" option to be able to search for first and last names inside of …

Member Avatar for Khoanyneosr
0
140
Member Avatar for shyla

Using an appropriate definition of listnode, design a simple linked list class with only two member function and a defult constructor: void add(double x) boolean isMumber(double x) LinkedList(); The add function adds a new node containing x to the front (head) of the list, while the isMember function tests to …

Member Avatar for Moschops
0
543
Member Avatar for naseerhaider

Hi , I've written following program that takes a four digits integer from user and shows the digits on the screen separately i.e. if user enters 7531, it displays 7,5,3,1 .Any one can tell me how it can be written better and how to display digit in linear order i.e. …

Member Avatar for mrnutty
1
2K
Member Avatar for youLostTheGame

I'm having troubles with a cin statement in my code and need some guidance. I need my code to refresh an array with completely different ASCII characters, then have the user enter a keystroke and have the refresh speed increase by a few hundred miliseconds every time. Now my C++ …

Member Avatar for arkoenig
0
136
Member Avatar for sinatra87

I recently received an 'A' on a program I submitted for the programming course I'm currently taking. I'm on spring break and I was hoping to use my spare time to do some studying, so I took my 'A' program and tried to run it in Visual Studio Express, and …

Member Avatar for sinatra87
0
2K
Member Avatar for SourabhT

[CODE] #include "stdafx.h" #include<iostream> using namespace std; class Shape { public: virtual void fun() { cout<<"in base"<<endl; } }; class Square:public Shape { public: void fun() { cout<<"in Square"<<endl; } }; class Circle:public Shape { public: void fun() { cout<<"in Circle"<<endl; } }; int _tmain(int argc, _TCHAR* argv[]) { Shape …

Member Avatar for arkoenig
0
701
Member Avatar for fibbo

I just cant get my head around it. Is there another way going through a singly linked list without using some kind of helper function? The header file wants me to implement: [CODE]size_t priority_queue::size() { /* code here */ }[/CODE] Now I just could create a helper function that has …

Member Avatar for fibbo
0
358
Member Avatar for israruval007

ok lets say i have the following text T 2 X F X 2 Y G Y 1 Z Z 2 G 1 I 3 T G E F 2 I E looking at the first line t is the vertex 2 is the number of edges it has and …

Member Avatar for israruval007
0
2K
Member Avatar for luislupe

Hi, I'm building a clustering algorithm and need to visualize how data is distributed and relationed. For this, I'm thinking in histograms (numerical and categorical data) and scatter plots. If possible, a 3D like plot like [url]http://www.opendx.org/inaction/datamining/images/original/mci3.jpg[/url] would be nice, but is not required. I'd like to be able to …

Member Avatar for L7Sqr
0
330
Member Avatar for lss123

In a program I am writing, the one line of declaring an ifstream object causes the program to "crash" and a non-zero return code to be returned. Instead of pasting the full program here, I'll paste a sample program that "crashes" just the same. I put "crash" in quotations because …

Member Avatar for JamesPhillips
0
676
Member Avatar for emanfman

Hi, I am really confused. Everywhere I read on the internet, I see that the += operator is part of the string class. I want to add something onto the end of the string. Why does my code not compile? I keep getting the C2088 error: illegal for class. If …

Member Avatar for emanfman
0
139
Member Avatar for hawita
Member Avatar for Fbody
0
311
Member Avatar for alice_k

Hi folks, I am learning C++ programming. Below mentioned program giving segmentation fault ONLY WHEN if I declare 'struct s a;' ABOVE 'struct s *b;'. Can anybody tell me the reason? [CODE] #include<iostream> using namespace std; struct s { int m; }; int main() { struct s a; // if …

Member Avatar for Moschops
0
718
Member Avatar for gomezfx

Hi, I have a question about generating a 1kHz sine wave. First of all, we can't use the sin function so I just made a function that evaluates sin at some point... [CODE]int generate_sin(int t); { int sin; sin = t - ((t^3)/(3*2*1)) + ((t^5)/(5*4*3*2*1)); return sin; }[/CODE] Now, this …

Member Avatar for drkybelk
0
2K
Member Avatar for Khoanyneosr

[CODE]cout << endl << "\n\n\nWhat would you like to do?"; cout << endl << " Add" << endl << " View" << endl << " Delete\n- "; cin >> todo; transform(todo.begin(), todo.end(), todo.begin(), toupper); cout << todo; bool done = true; while (!done) { if (todo == "DELETE") { system("cls"); …

Member Avatar for Fbody
0
102
Member Avatar for Theisonews

how do i make an array read from a file. i tried google it. but i cant get it to work.[CODE]// theisonewscpp.cpp : Defines the entry point for the console application. // #include<iostream> #include <vector> #include <algorithm> using namespace std; bool myfunction (int i,int j) { return (i<j); } int …

Member Avatar for Theisonews
0
465
Member Avatar for predator78

Hello I'm learning a bit about data structures for the first time and so far I seem to understand how they work "I think" at this stage. My questions at this point would be. 1. Are data structures essentially classes minus methods which can preform actions on the memebers that …

Member Avatar for NicAx64
0
373
Member Avatar for aprilchica3

Hello, I have spent numerous hours re-working this code and I hope someone can clear up my confusion! This program asks the user to enter a file name which will then create and display that file with a poem in all caps. The user is again prompted to enter another …

Member Avatar for aprilchica3
0
171
Member Avatar for sergent

This is when I try to output uninitialized characters on the screen. I thought C++ should declare all of them to 0's (or '\0' for characters) when I declare them without initializing?

Member Avatar for NathanOliver
0
109
Member Avatar for TheSassyDragon

Im trying a practice problem from a textbook and here is my attempt at it, was wondering if I could get some advice both with structurally how to approach the problem, efficency, and any words of wisdom on dynamic memory. This is my study for my final exam which so …

Member Avatar for Lerner
0
276
Member Avatar for sha11e

Heard people say c# for big programs, c for fast programs and c++ is just something that failed at being object oreanting c is c++ useful?

Member Avatar for sergent
0
210
Member Avatar for jjssll

Hi guys, I'm new in C++ and I tried to compile the attached code without success. This is the output when using g++ under Ubuntu system /src$ g++ -c -Wno-deprecated -I../include Options.C Options.C: In constructor ‘Options::Options(const char*)’: Options.C:13: error: ‘parsequestion’ was not declared in this scope I tried several modifications …

0
131
Member Avatar for programing

i am write program that insert at tail in circular singlelinkedlist but i have some errors .. [ICODE]#include<iostream.h> struct node { int info ; node * next ; }; class clist{ private : node *tail; int size; public: clist(){ tail=NULL; size=0; void addtail(int x){ node *p=new node; p->info=x; if(tail==NULL) p->next=p; …

Member Avatar for programing
0
93
Member Avatar for sha11e

After some google-ing I found a page saying that .o files are " “Object Code” is just the translation of “Source Code”, which can be referred as machine language code." What .depend files are I didn't really understand. Someone said it... kinda... links to libraries or something? Else my exe …

Member Avatar for nezachem
0
178
Member Avatar for L0s3r

[CODE]class mymatrix{ private: int** arr; int m ,n; public: mymatrix() { std::cout<<"\nConstructor entered."; std::cout<<"\nEnter no. of rows of the matrix:"; std::cin>>m; std::cout<<"\nEnter no. of columns of the matrix:"; std::cin>>n; arr = new int*[m]; for(int i=0;i<m;i++) { arr[i]=new int[n]; } std::cout<<"\nConstructor exited."; } /****************************************************************************************/ mymatrix (mymatrix& t) { m=t.m; n=t.n; std::cout<<"\nCopy …

Member Avatar for L0s3r
0
186
Member Avatar for Labdabeta

I am making a diplomacy tool, for the board game diplomacy. I need to make a map of each territory. I have a 75 #define MAP_"NAME" lines but I don't know how to set them to a mask value that can be checked since I don't know any 75-bit or …

Member Avatar for Labdabeta
0
196
Member Avatar for pengkeanh

Hi All, For each element in data1, I need to figure out what elements in data2 are related to it. Also, for each element in data2, I need to figure out what elements in data1 are related to it. Therefore, I setup a mutual data structure as you can see …

Member Avatar for pengkeanh
0
277
Member Avatar for noobcoder

Hello all, I will be placing my source code onto pastebin and making it private as I am scared of my fellow students stealing my hard work for this class. So far I have about 1000 lines of code that is pretty easy to understand and it compiles and runs …

Member Avatar for noobcoder
0
2K

The End.