51,593 Topics

Member Avatar for
Member Avatar for bookmark

Hi, I have this program that outputs a triangle when given the size. Right now the triangle outputs like this [CODE] 5 * ** *** **** ***** [/CODE] Does anyone know how I would make it look like this? [CODE] 5 1 12 123 1234 12345 [/CODE] Thanks in advanced …

Member Avatar for bookmark
0
215
Member Avatar for steve_Student

Hi i have created a program for my college assignment which asks to create a program for a telephone company that requires the program to calculate call charges for their customers, and also give discount calls depending on the time of day and day of the week. The assignment also …

Member Avatar for sakijr
0
202
Member Avatar for seanbp

These days, it's usually unnecessary to consider how much memory to allocate for a string input. This was mostly for fun. This code allocates memory as the user inputs each key stroke, then allocates and returns a string pointer when the user presses enter. Tell me what you think! [B]USAGE:[/B] …

0
332
Member Avatar for by_stander

Hey everyone, I have a Matlab code that parses data from a csv file, performs some calculations on the data, and spits it back out into a new csv file. the new csv file contains all the data from the original file, with the new calculations appended on at the …

Member Avatar for jonsca
0
237
Member Avatar for sanjuanair

Frndz, I want to now how to start learning C/C++ programming in my pc. means there is a problem with installation of normal turbo c in my computer. it is not working. [COLOR="Green"]So what software i have to install? From where i can download it? Is there any C++ software …

Member Avatar for seanbp
0
116
Member Avatar for johngalt10

I'm new to scripting. I'm trying to find out how to target my cout to a field in a gui. Any direction will be greatly appreciated.

Member Avatar for jonsca
0
100
Member Avatar for christos312

Ok this is very strange and i cannot see where is the problem and i guess is really easy but i cannot see it so i will need your help :-O My Declarations [CODE]int myGraph[4][4]; int vertices[4]; char path[4];[/CODE] My initialize code [CODE]for(int i=0; i<=4;i++) { for(int z=0; z<=4; z++) …

Member Avatar for christos312
0
154
Member Avatar for yatman

I have a function below which is supposed to read from a continuous updating file...by another program. for this reason I used a fileptr int to keep track of the last known good read so this index value is updating correctly but it is not being used by getline. and …

Member Avatar for vijayan121
0
160
Member Avatar for helpfullProgram

Hello everyone! I am programming a vector which stores a name and a number. [code] typedef pair<int,string> Users_Pair; vector<Users_Pair> Users_Name; [/code] And the vector expands and contracts through out the life of the program. But when I use erase all elements above the one being erased loose their string? I …

Member Avatar for Narue
0
199
Member Avatar for sdinu96

Hi everyone I want to open the Directory like this using C++ in linux eg : /proc/1/status where proc and 1 is a directory and status is a file,which i want to access(i.e)this file i have to copy to an string to access some information..................can anyone help

Member Avatar for Ancient Dragon
0
67
Member Avatar for SusanHAllen

Hello all, I have a windows application with a DataGridView. I have successfully bound the DataGridView to a datasource (datatable based on database query). I would like one of the columns to be a ComboBox that is selected to the correct datasource value, yet upon click displays data from a …

Member Avatar for SusanHAllen
0
1K
Member Avatar for networkZombie

...so I'm trying to make a program that takes in the three sides of a triangle and then decides whether the triangle is equilateral, isosceles or equilateral. I have to have 2 different functions and I can't use global variables ( That's what my teacher wants ). My main function …

Member Avatar for Dingbats
0
273
Member Avatar for elsiekins

Simmilar problem again using a vector of length 4 [CODE] vector <char> something; something += '1','2','3','4'; somefunction(something,4); [/CODE] some function takes in a [CODE]char* ptr, unsigned int size[/CODE] at the moment i am getting "error C2664: 'something' : cannot convert parameter 1 from 'char' to 'char *" any help would …

Member Avatar for elsiekins
0
145
Member Avatar for asifakram

hi all...recently i was given a project of making a scientific calculator using microsoft visual C++....so i downloaded some codes...but there is this graphics.h file which is not supported by VC++ !!. can any one help me with the codes of a scientific calculator in VC++...without using any graphics.h file …

Member Avatar for Bilal Anwar
0
274
Member Avatar for Translucentbill

I have been working on a text based adventure game as a project for school. I have become very well acquainted with functions, loops, arrays, etc. I now have to begin thinking on a senior project utilizing something we worked with this year and I love to code but I …

Member Avatar for SgtMe
0
329
Member Avatar for yatman

Hi, I have an application which fills a text file continuously and my program monitors that file for a string match continuously. My search function is fine..but Since the file keeps on growing is there a way I can read from the position I left off last or do I …

Member Avatar for Clinton Portis
0
66
Member Avatar for FutureWebDev

When testing the output of a variable of type double, with [B]expected results = 48.66573405[/B], I am getting an [B]actual result = 48.6657[/B]. Why is the expected result being rounded when the whole idea of using type double is to increase the precision of your calculations? Thanks FWD

Member Avatar for FutureWebDev
0
188
Member Avatar for jcax

Hi all, I'm trying to create two classes which each of them contain a vector of object of the other class. Below is roughly the idea of what I'm trying to do but it seems that it cannot work as it will end up into infinite recursion or something. What …

Member Avatar for jcax
0
132
Member Avatar for rgutierrez1014

Hi everyone, So I have a binary tree class, Stree, that holds names of cities and pointers to other cities. Running the program and typing "insert Memphis Atlanta" inserts a node with Memphis, and inserts a node with Atlanta as Memphis's left child. Typing "insert Memphis Tampa" inserts a node …

Member Avatar for gerard4143
0
191
Member Avatar for aria12

ok, below is the code that i have tried and still not working; #include <stdio.h> int main () { char Name; int Age; int Date_Of_Birth; float Place_Of_Birth; float Email_Address; printf ("Name:"); scanf ("%c",&Name); printf ("Age:\n"); scanf ("%d",&Age); printf ("Date Of Birth:\n"); scanf ("%d",&Date_Of_Birth); printf ("Place Of Birth:\n"); scanf ("%s",&Place_Of_Birth); printf …

Member Avatar for gerard4143
0
116
Member Avatar for MarounMaroun

Salam, lets say I have declared: [code=c]int* array=new int[SIZE];[/code] (I used this array as if it was a 2D array - lets say that I'll consider these dimensions: row, column). and I want to pass this array to a function that will fill the array row by row. (The function …

Member Avatar for abdelhakeem
0
145
Member Avatar for rhn94

I've been writing a pig latin translation program for a week in class now and i've gotten so far but now i don't know what to do. i need to check if the word has a vowel as the first letter then only add ay in the end if it …

Member Avatar for rhn94
0
740
Member Avatar for FutureWebDev

The program below is executing fine but when I enter the last of 10 numbers and the final output(shows the average of the 10 numbers) is displayed, I get the following error message: Run-Time Check Failure #2 - Stack around the variable 'numbers' was corrupted. If someone could explain what …

Member Avatar for FutureWebDev
0
197
Member Avatar for localp

I am using VS2008, OS win vista. i am in the process of coding an application that would tab automatically (this is just an example, not the code i am intending to do). So basically, what i expect is to write a C++ code that could press the 'tab' button …

Member Avatar for Fbody
0
11K
Member Avatar for MarounMaroun

[code=c] #include <cstdlib> #include <iostream> static void fillArray(int **array); int main() { //allocating a 2D array int **array; array=new int*[10]; for(int i=0;i<10;i++) *(array+i)=new int[5]; //sending this array to a function fillArray(array); for(int i=0;i<10;i++) for(int j=0;j++;j<5) std::cout<<array[i][j]; for(int x=0;x<10;x++) delete[] array[x]; delete[] array; return 0; } static void fillArray(int **array) { …

Member Avatar for alexchen
0
84
Member Avatar for alexchen
Member Avatar for alexchen

Error 1 error C2440: '=' : cannot convert from 'const char [2]' to 'char' [CODE]bool word(char *Filename){ int r,number,length; ifstream file; file.open(Filename); file>>number; srand ( (unsigned)time ( NULL ) ); r=rand() % number+1; string input,word; for(int i=0; i<r; i++) getline(file,input); length=input.length(); for(int l=0;l<length;l++)word[l]="_"; cout<<input<<endl<<word<<endl;; return true; }[/CODE]

Member Avatar for arkoenig
0
83
Member Avatar for karthikdebbadi

Hi all, I am pretty new to c++ and linux. I am developing an application where backup of files occurs when ever a new file or a deletion of a file is done a specific directory. for this purpose i use rsync to make a backup on a remote server. …

0
47
Member Avatar for Anuradha Mandal

what is worng with this code [CODE]#include<iostream> #include <graphics.h> #include <stdlib.h> #include <stdio.h> //#include <conio> int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, "C:\\Dev-c++\\include\\graphics.h"); /* read result of …

Member Avatar for Anuradha Mandal
0
1K
Member Avatar for abelingaw

Using Borland C++ 3.0 Here's my code: [CODE] #include<iostream.h> #include<conio.h> int main() { int m,d; int i=0; clrscr(); cout<<"\nEnter Birthday month: "; cin>>m; cout<<"\nEnter Birthday day: "; cin>>d; cout<<"\n"; { if(m==3 && d>=21) cout<<"ARIES!"; else if (m==4 && d<=20) cout<<"ARIES!"; else if(m==4 && d>=21) cout<<"TAURUS!"; else if(m==5 && d<=21) cout<<"TAURUS!"; …

Member Avatar for abelingaw
0
604
Member Avatar for NMAZ

[B][U]Hi, this is kind of silly request, can anyone help me with these three C++ progs[/U]:[/B] [B]I - Predefined number of operation Calculator[/B]: [U]e.g[/U]. 5 + 12 - 3 10 / 3 - 5 /12 The program should ask for the following 1- number of operations 2- the equation for …

Member Avatar for NMAZ
0
234
Member Avatar for MylesDBaker

Hello All, I am trying to solve maximum flow, and I am experiencing some problems formatting the output. Here is some pseudocode I am trying to implement. c [u, v] is capacity from u to v, f [u, v] is the flow, cf [u, v] is the residual capacity. for …

Member Avatar for daviddoria
0
233
Member Avatar for ravindasenarath

hello, I'm a newbie to opencv. I'm doing a project using c++ and I use opencv for image processing. So for that I need to capture two video streams at the same time. before doing processing part I try to display both videos from cameras on two windows. But it …

Member Avatar for daviddoria
0
151
Member Avatar for Nandomo

Ok I have a little problem.I have a pointer in the struct which I don't know how to use as or move the information into an array on the bottom function. Need an explanation. Anyone please help... [CODE] // This is the minimum functionality for this exercise // Notice that …

Member Avatar for Fbody
0
217
Member Avatar for Lando_

I basically know how functions work now but this problem is just confusing me. Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: -void getScore() should ask the …

Member Avatar for WaltP
0
119
Member Avatar for tawes01

I want to have a live clock in the statusbar. When I put SetWindowText before the switch in the callback, like this: [CODE]BOOL CALLBACK MainDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { time_t rawtime; struct tm *timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); strftime(thetimeis,79,"Current Date and Time: %A, %B %d, %Y …

Member Avatar for xuancong
0
241
Member Avatar for samoz83

Hello, Im writing a banking system program for one of my assignments using classes, i've got the some basic stuff done but I can't for the life of me work out how to read data out of a file i've previously created and display it on screen. (I've cut the …

Member Avatar for jonsca
0
82
Member Avatar for shadowscape

[CODE]// Project: XorLib - Xor Encryption Libary. // Copyright: Copyright © 2009-2010 Shadowscape Studios. All Rights Reserved. // Developer: Shadowscape Studios // Website: http://www.shadowscape.co.uk // Support: support@shadowscape.co.uk // Version: 1.0.0.0 // Release: 151220102240 #define export __declspec (dllexport) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> long filesize(FILE *f) { long …

Member Avatar for shadowscape
1
765
Member Avatar for seanbp

[CODE] DynamicTypeList list; list.add(42); list.add("forty-two"); for (DynamicType* item = list.begin(); item != list.end(); item++) { if (item->what_type == item->is_int) { cout << item->integer << endl; } else if (item->what_type == item->is_string) { cout << item->string << endl; } }[/CODE]

0
592
Member Avatar for seanbp

I was reading a post somewhere on this site about making a type-dynamic list and came up with this. The issue is I'm thinking it's leaking memory when the list grows. Finally, are there any ways to improve this code? [CODE]#include <iostream> using namespace std; class DynamicType { public: union …

Member Avatar for seanbp
0
111
Member Avatar for krosty4782

Hi! Im having a problem in the next line: i = socket.Receive(buffer) buffer is defined as: byte[] buffer = new byte[1024]; It crash when its waiting for the answer. In c++ im sending this: len = send(sock,"hola",4,0); Any idea? Thanks

Member Avatar for krosty4782
0
177
Member Avatar for meensatwork

Iam getting the error Heap Corruption Detected if i run the following program. If i comment out the line delete[], iam not getting the error. Also if i change the [B]outTxtStr = new char[outTxtLength + 1][/B] to [B]outTxtStr = new char[50][/B] iam not getting the error. Does anybody have some …

Member Avatar for meensatwork
0
131
Member Avatar for Lando_

Final Edit: lol im dumb but the brackets backwards [CODE]#include <iostream.h> int main() { const int SIZE = 10; int numbers[SIZE]; int count1; int count2; int highest; int lowest; cout << "Enter an array of ten and I will find the highest and lowest" ; cout << " values" << …

Member Avatar for seanbp
0
118
Member Avatar for rgutierrez1014

Hi everyone, So I tried making my program here, and I got an error that I can't figure out. I have a class for a Binary Tree, "Stree", with a few methods defined publicly, and a "Node" class defined privately, within "Stree". These methods use "Nodes" as parameters. Now when …

Member Avatar for rgutierrez1014
0
280
Member Avatar for crosario90

Im writing a progam that calculate a person test score then prints out a letter grade bt i need to modify it so that the function "PrintGrade" actually keeps track of the highest score entered this is what I have so far... //This program reads a course score and prints …

Member Avatar for crosario90
0
175
Member Avatar for DevonParsons

Hi Daniweb, I've almost always found solutions for various problems before and have now decided to become a member so I can contribute as well. I would consider myself a so-so programmer (I understand classes, pointers, matrices, I/O, vectors, and of course structure). I am only able to make code …

Member Avatar for daviddoria
0
164
Member Avatar for steve_Student

Hi i have completed my assignment for my foundation degree, the details of the assignment are attached describing the C++ program which to be created, which is for a telephone company to log calls and give discount depending on the time of day and day of the week, and to …

Member Avatar for daviddoria
0
245
Member Avatar for sharifyboy7

I am having trouble with my print function for my linked queue. My compiler error is pointing towards cout << tempPtr->info << " "; line 149 tempPtr = tempPtr->next; line 150 in my print function. Can anyone help me fix this? Thanks CODE: [CODE] #include <iostream> #include <cstddef> // For …

Member Avatar for jonsca
0
320
Member Avatar for Lando_

Using Borland 4.5 I think I got most the program done but its hard for me to setup functions with returning names and values. Problems States: Winning Division: Write a program that determines which of a company's four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a …

Member Avatar for Lando_
0
1K
Member Avatar for Violet_82

hi guys, I am working on a project for my school, and I was wondering whether I can get some guidance and tips on how to tackle it. Here’s the problem in brief: I was asked to develop a program so that users can input the data values of 2 …

Member Avatar for Violet_82
0
91

The End.