49,757 Topics

Member Avatar for
Member Avatar for rfrapp

I'm writing a program that is supposed to search an array between the values of -1000 and 1000, as well as sort it using the 3 different sorts (bubble, insertion, selection). I have the searching part done, but my bubble sort isn't working right. It seems right in my head, …

Member Avatar for DeanMSands3
0
174
Member Avatar for jigglymig

my problem is the Point plus(Point). how should I declare it and all that. [CODE]// point.h -- This creates a point with both x and y of type integer #include <iostream> using namespace std; template<typename T> class Point { private: T x; T y; public: Point(T,T); Point(); void set_x(T); void …

Member Avatar for jigglymig
0
108
Member Avatar for konon_genius

Given the following C++ code and input (Figure 1): struct POINT{ int x; int y; }; struct SHAPE{ struct POINT pt1; struct POINT pt2; struct POINT pt3; struct POINT pt4; }; void setSHAPE(struct SHAPE &); int calcArea(struct SHAPE); void main() struct SHAPE RECTANGLE; //your code starts here }//your code ends …

Member Avatar for deceptikon
-1
138
Member Avatar for boris90

Hi! I've been having this problem recently: I wrote this code which, practically, reads lines of text from a text file (e.g. Microsoft Notepad file) and stores them into a vector. Each line has three parts: the product code, the product amount and the product name. The user is offered, …

Member Avatar for boris90
0
528
Member Avatar for C++ programmer

what does the following code means in Qt programming.. QDialogButtonBox::Ok why are we using QDialogButtonBox:: .

Member Avatar for Eagletalon
0
197
Member Avatar for skorm909

Hey, I was about to get started just making a simple text game and was wondering how to make it so the game came up in a different window other than the CMD? Like how can I make it come up in say.. A 400x200 Window? Where I could customize …

Member Avatar for DeanMSands3
0
97
Member Avatar for rfrapp

For part of a programming that I'm writing, I want to generate random numbers between the range of -1000 and 1000. My teacher never spent much time on the rand function, and I'm not quite sure how to specify a range like that. Any help would be greatly appreciated. Thanks!

Member Avatar for skorm909
0
2K
Member Avatar for triumphost

Someone please tell me the difference between 0 and '\0' and NULL. I thought I knew it! 0 and NULL is the same thing "Essentially".. '\0' is a null terminator for a string.. It's just sometimes when I convert a string to char array and do some encryption on it, …

Member Avatar for mrnutty
0
232
Member Avatar for tanvirraj91

can anyone give any link to download "programming with c++" by "d ravichandran"

Member Avatar for Ezzaral
0
71
Member Avatar for droneerror

I am trying to create a prime factorization c++ program, and halted immediately by this "else" error. I would really appreciate some assistance with my coding. I am new to c++, so I am just getting used to the rules. Here is what I have so far: [CODE]#include <iostream> using …

Member Avatar for frogboy77
0
2K
Member Avatar for vic s

hi, my name is vic...i got one problem cannot fix....output for the number of times each of the tasks has been invoked...i run 3 times each of the tasks but the output always is this program has run 1 times..... [CODE]#include<stdio.h> #include<stdlib.h> void doTaskA(){ printf("Start of Task A\n\n"); int input_1, …

Member Avatar for Labdabeta
0
150
Member Avatar for pjh-10

im terrible at c++, absolute beginner, i can start and end programme writing, just the functions im awful at, for this one below, what is the ,to say, middle part of the programme Using <cmath> function pow(x,x), find x^x in small steps of 0.5 starting at x = -1 to …

Member Avatar for DavidB
0
140
Member Avatar for engineerchica

Hi all, My code for a function to count words is posted below, and the only error that appears when I build it in my compiler is that char present is uninitialized. My program will not run with this uninitialized value. I've been searching for info on how to initialize …

Member Avatar for engineerchica
0
458
Member Avatar for zekstein

I took curl-7.24.0.zip from their site [url]http://curl.haxx.se/download.html[/url] and compiled libcurl ... i've got only the .lib Now, what to do ? EDIT : Im also needing a simple example on how to retrieve a website content ( blablabla.com?uid=1 ) in a char using wininet. I tried [code] HINTERNET hINet, hFile; …

0
72
Member Avatar for dekker13

[CODE] public: Mixed(int whole = 0); Mixed(int whole, int num, int denom); bool SetFraction(int n, int d); bool SetFraction(int n, int d=1); bool SetValue(int w, int n, int d); int getWhole(); int getNumerator(); int getDenominator(); void showFraction(); double Evaluate(); void Simplify(); void ToFraction(); Mixed& operator++(); //prefix increment Mixed operator++(int); //postfix …

Member Avatar for dekker13
0
293
Member Avatar for lupacarjie

See I created a program that accepts three values from the user to be arranged as a linked list(ascending order). After it asks a number, it displays the content of the list. The output is like this: [CODE]Enter number: 6 List value: 6 Enter number: 4 List value: 4 6 …

Member Avatar for lupacarjie
0
298
Member Avatar for npsgaming

I have put together some code for a homework assignment and I have almost got it working. There are a few key items that are missing or not fully functional and I am fresh out of ideas on how to attack it. The code is to take 9 digits/integers from …

Member Avatar for deceptikon
0
201
Member Avatar for Awais Ali

Can anyone help me by giving out a complete tutorial on the step by step way a connecting to a database using C++ ?

Member Avatar for Awais Ali
0
77
Member Avatar for jonnyboy12

Hello all . I have just started using the gcnew instead of new for the public ref class, that i have needed to learn for windows forms. I have a problem that shouldn't be as difficult as it is. I have a class that i made called vector2 . It …

Member Avatar for thines01
0
174
Member Avatar for ruval002

ok, i need help with changing the state of a process. So far my struct Process has an integer which contains the priority and a pointer next which points to another process, and i need to add a state so that every time i call the function insert() it would …

Member Avatar for L7Sqr
0
460
Member Avatar for sumanth232

#include<stdio.h> int ways(int n,int m) { if(n=0) return m; if(m=0) return n; else ways(n,m)=ways(n-1,m)+ways(n,m-1); //there is an error here.pls explain// return ways(n,m); } int main() { int a,b; printf("give a and b"); scanf("%d %d",&a,&b); ways(a,b); printf("the no of ways from (%d,%d) to (0,0) are %d",a,b,ways(a,b)); return 0; } what is …

Member Avatar for MandrewP
0
924
Member Avatar for chuyauchi

I have difficulty to declare the following type of array. 1/36, (one divided 36) 2/36, (two dvided 36) 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/36, 1/36 [CODE]double exptRoll [arraySize] = { 1/36, 2/36, 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/36, 1/36}; [/CODE] This doesn't work. Can someone tell …

Member Avatar for MandrewP
0
97
Member Avatar for chuyauchi

How can I set the [U]Actual rolls[/U] and [U]Expected rolls[/U] to no decimal, and [U]Actual percentage[/U] and [U]Expected percentage[/U] to 1 decimal plus a % symbol ? [url]http://images.plurk.com/a2f077138ef908ce71f46b08909c998d.jpg[/url] [CODE] cout << "Point" << setw(17) << "Number of Rolls" << setw(17) << "Actual Percent" << setw(17) << "Expected Rolls" << setw(17) …

Member Avatar for mrnutty
0
190
Member Avatar for Tiffany216

Assignment 2-a: Program 1: You are given the task of determining the download speed of an Internet connection. You decide to use two files whose size is known (in Kilobytes-KB). You will download the two different files, and record the time it takes to download each one. You will determine …

Member Avatar for DeanMSands3
0
122
Member Avatar for chuyauchi

I'm making a dice program that calculates the statistics such as actual percentage, expected rolls and expected percentage and so on. I'm having a difficulty on the Pseudo random number generation. With two dice, the mim. sum of the dice is 2, not 1. There is something wrong with my …

Member Avatar for DeanMSands3
0
148
Member Avatar for Labdabeta

I was working on a project when I thought that maybe a ::. operator would look funny in some code. Just for fun I typed that into the global scope area like this: [CODE]::. int main() { //etc...[/CODE] and my code completion software said too many results to display. My …

Member Avatar for Labdabeta
0
195
Member Avatar for xnycdplx

Hi I'm trying to read in actors from a file that I got off IMDB and I wanted it to be searchable to whenever the user enters an actors name, the program would output the movies the actor has starred or been associated with. I've gotten the search function to …

Member Avatar for Lerner
0
803
Member Avatar for zekstein

I need a sample code to retrieve the source code of a page . Ex : I have [url]www.blahblahblah.tld/file.ext?id=blah[/url] I want to retrieve in a char the source code of that site. Thanks

Member Avatar for thines01
0
407
Member Avatar for badboy11

Looking for an equivalent container class that matches to C#'s Arraylist collections class. Is there anything that comes close to a container that can provide index based enumeration as well as hold multiple data types. I am trying to create an vector that can hold multiple data types. For example: …

Member Avatar for badboy11
0
979
Member Avatar for n4j

Hello every one! i write an implementation for kruskal's algorithm but i think it doesn't work properly! The final tree has loop! this is my problem. Can you tell me how i can solve this problem? here is the code: [CODE] #include <stdio.h> #include <conio.h> #include <iostream> using namespace std; …

Member Avatar for n4j
0
309

The End.