49,766 Topics

Member Avatar for
Member Avatar for mbouster

Hi guys, I need to implement a program for simulating the flooting algorithm. Can someone suggest from where to start. I will use structs or classes? How the flow of the program will be?

Member Avatar for mbouster
0
2K
Member Avatar for eman 22

is there a way to convert from pointer array to array I tried the following, but it doesn't work. [CODE] int[]a={1,2,3}; int* p; p=a; a=(*P);// doesn't work [/CODE]

Member Avatar for mike_2000_17
0
88
Member Avatar for choboja621

I`m new in Programming stuffs. So here is my codes: [CODE]#include<iostream.h> #include<conio.h> float records[5][5]; float ave; int ctrX, ctrY; main() { clrscr(); ctrY=0; for(ctrX=0;ctrX<=4;ctrX++) { cout<<"Student Number: "; cin>>records[ctrX][ctrY]; ctrY++; do { cout<<"Quiz 1 Score: "; cin>>records[ctrX][ctrY]; if ((records[ctrX][ctrY]<0)||(records[ctrX][ctrY]>30)) { cout<<"The score supplied must be from 0 to 30 only!" …

Member Avatar for Moschops
0
97
Member Avatar for atticusr5

Hello all, So I am just playing around with different ways to format output to the command line in c++. I already found information on how to change the color of standard output (both in Linux and Windows). Is there a way to highlight output to the command line? I …

Member Avatar for L7Sqr
0
59
Member Avatar for jeffpro

Hello again guys, I've got kind of a noob question. I have a wchar[260] and I need to compare it with a char* and im getting the error error C2664: '_stricmp' : cannot convert parameter 1 from 'WCHAR [260]' to 'const char *' Thanks!

Member Avatar for Narue
0
119
Member Avatar for zulkefli82

anybody can help me? How to culculate totalsale for each division.. I've tried many time but failed.. my coding is below [ICODE] #ifndef DIVISIONSALE_H #define DIVISIONSALE_H class DivisionSale{ private: double sales [3]; double totalSales; public: DivisionSale(double,double ,double ,double); double getQuaterSale(int); double getDivisionSale(); void culculateTotalSale(DivisionSale[], int); }; #endif[/ICODE] [ICODE] #include "DivisionSale.h" …

Member Avatar for zulkefli82
0
118
Member Avatar for pravej

Anyone can help me to write a code in C++ to reverse a string. Example: i/p= " string with space " o/p= " ecaps htiw gnirts " Better if we use function or class. Thanks in advance

Member Avatar for template<>
0
244
Member Avatar for cableguy31

As part of a school assignment, I have to analyze a binary and determine what is does and what it takes to cause the various "branches" (if statements) to be triggered. I performed a strace on the file and the only part that stands out is a gettimeofday call: [CODE]gettimeofday({1303744469, …

Member Avatar for template<>
0
372
Member Avatar for littleleaf

Hi all, I am constructing a program on TCP sockets. The server should be able to accept connections from more than 1 clients. My programs seem working fine when accepting connections. Now the problem is: when I try to terminate one of the client programs, the server program would also …

Member Avatar for littleleaf
0
434
Member Avatar for gcardonav

Hi guys: I am constructing this simply code to read a number of columns in a file, get a number and produce a new file. I am just not certain what is wrong. I used the same standard as an old code of mine so it should work but I …

Member Avatar for gcardonav
0
141
Member Avatar for CodyOebel

OK im having a problem which I feel should be super easy within windows API gui programming, but I dont know how to go about it the right way. On a givin HWND when a single mouse click is qued and my program recognizes it and my windproc processes it …

Member Avatar for template<>
0
146
Member Avatar for Gnomy

I've been searching this for a little while now and I'm absolutely unable to figure out what the problem is. This is the code I'm having the issue with: [CODE] std::vector<std::string> TexName; TexName.push_back("mega.png"); [/CODE] and I get... error: 'TexName' does not name a type I've included both vector and string …

Member Avatar for template<>
0
547
Member Avatar for munitjsr2

[CODE] #include <iostream> #include <vector> #include <iomanip> using namespace std; class DAI //DynamicArrayInput { public : void getCountry() { cout << "Country : "; cin >> Country; } void putCountry() { cout << Country << endl; } static int putCount() { return count; } private : static int count; char …

Member Avatar for Fbody
0
310
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
90
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
142
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
554
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
3K
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
138
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
719
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
367
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
331
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
698
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
145
Member Avatar for hawita
Member Avatar for Fbody
0
314
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
721
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
103

The End.