49,757 Topics

Member Avatar for
Member Avatar for kadhaipaneer

I have a problem passing an array containing pointers. Here's the function.. [code=c++] void jointtree(Parent *clique[], int nodes); [/code] I am calling it the following way.. [code=c++] jointtree(clique, nodes); [/code] where clique is. [code=c++] Parent *clique[nodes]; [/code]

Member Avatar for L0s3r
0
153
Member Avatar for Derek Elensar

This is my final project for my C++ class online. I was instructed to make a test and to pull answers from withing a .txt file and compare them to the answer that the user inputs. I'm sure there's a much easier wau of doing things than the way I'm …

Member Avatar for Derek Elensar
0
226
Member Avatar for dilequeno

I am trying to write a program in c++. I have a file that contains thousands of numeric entries sorted into four columns. The structure of the data looks something like the following: 3 0.2 0.5 6.2 4 0.1 0.6 6.2 //Track 1 2 0.8 0.5 0.6 2 0.6 0.5 …

Member Avatar for Ancient Dragon
1
313
Member Avatar for kutuup

Hi all, I'm trying to build a program in visual studio 2008, when I build in debug mode, it runs just fine, but if I try to build in release mode, there are no errors but when the program runs I get this error: The program can't start because MSVCR90D.dll …

Member Avatar for kutuup
0
491
Member Avatar for Drau

im trying to convert double to string with this code: if its a number like 3.7345 than its working - but if its 5.0 (only zeros after the point) [CODE] double number=5.0; string ToString; stringstream out; out << number; ToString = out.str(); return ToString;[/CODE] it returns - 5 and i …

Member Avatar for Drau
0
150
Member Avatar for kutuup

I'm trying to read integers in a .txt file into a 2 dimensional array (map). Here is the function: [CODE] void loadmap(int mapnum) { int x; ifstream inFile; inFile.open("level1.txt"); if (!inFile) { cout << "Unable to open file"; //exit(1); // terminate with error } for(int countline = 0; countline <= …

Member Avatar for kutuup
0
341
Member Avatar for axeves

Hi. Can you explain to me on how to "inherit" (if that's the right word) stuff from a header file, and on how to write one? (A header file) Like if i wrote this; [CODE] class Foo { int a = 123; } [/CODE] in a header, how would i …

Member Avatar for pseudorandom21
0
121
Member Avatar for Muhammad Anas

I just found a question whose statement is as follows: [COLOR="Green"]Write a function contains(const char*, char) which returns the pointer to the first (left-most) occurrence of the 2nd parameter char in the 1st parameter cstring, or NULL if the cstring doesn't contain the char. [/COLOR] Another condition is that inside …

Member Avatar for Muhammad Anas
0
263
Member Avatar for luislupe

I have several vectors of int elements. Now I want to create a vector of vectors, but I don't want to copy the vectors to the new one. If possible, I'd like to pass them by reference. Please consider: [code=c++] #include <iostream> #include <vector> using namespace std; int main () …

Member Avatar for ravenous
0
202
Member Avatar for karenjev

Good day, i'm creating a calculator in c++ using visual c++. I got error's as below [CODE]c:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(19) : error C2144: syntax error : '__w64 unsigned int' should be preceded by ';' c:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(19) : error C4430: missing type specifier - int assumed. Note: …

Member Avatar for fpm777
0
1K
Member Avatar for lochnessmonster

im curious as to if anyone knows the internals of how cout works? for example the step by step internals of what happens when executing the following statement in c++ cout << "hello world" << endl; -thx

Member Avatar for vijayan121
0
117
Member Avatar for curly3top

help me please :sad: if you can find out what's wrong w/ my program, please do tell. thanx very much! #include <iostream> using namespace std; void get_start(int start_hour, int start_min) //Precondition: User is ready to enter the values for the hour and the minute. //Postcondition: Values in hours (24-hour notation) …

Member Avatar for pseudorandom21
1
223
Member Avatar for jenymaru08

elow I'm trying to create a program that will display the output : [code] * ** *** **** [/code] please help me [code=c] int main() { for(int i=0;i<=7;i++) {for(int j=0;j<=i;j++) cout<<'*'; for(nt k=0;k<=i;k++) cout<<' '; [/code] then what next its only give the output [code] * ** [/code] please help …

Member Avatar for EMDArellano
0
127
Member Avatar for AlvinLiu

/** readGradeFile ******************************************************* * Read the data from inf into the parallel arrays given. * @params inf -- input file to read data from @pre inf is already open * id[] -- container for student id #s * asgts[] -- container for assignment grades * mt[] -- container for mid-term …

Member Avatar for VernonDozier
0
140
Member Avatar for creck

hi, i would like to ask you to help me 'cause i am pretty new in programming and idk what's wrong with that :/ i am still getting an error that " 'main' must return 'int' "...thanks [CODE]#include<iostream> #include<string> using namespace std; class GradeBook { public: void displayMessage(string courseName){ cout<<"Welcome …

Member Avatar for Narue
0
83
Member Avatar for Argo54325

Hello I'm getting these 2 LNK errors and haven't been able to figure out how to resolve them, any help is greatly appreciated! Its was an empty Win32 Application that i created and added code into from existing source. [CODE]Error 1 error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function …

Member Avatar for Argo54325
0
228
Member Avatar for lexusdominus

I am a beginner with win32 programs, and am trying to integrate my console into a window. My console program starts a new thread which creates a window. [CODE]DWORD dwThreadID = 0; HANDLE hThread = CreateThread(NULL,0,ThreadProc,argv[0],0,&dwThreadID);[/CODE] i want to create a miniature output textbox within my window, which reads the …

Member Avatar for Ancient Dragon
0
210
Member Avatar for DotNetUser

I have to pass a pointer to a callback function. When the callback function is not a member function in my class, the argument &callback works. When I make the callback function a member function, I get a compiler error: "error c2276 '&' : illegal operation on bound member function …

Member Avatar for pseudorandom21
-1
2K
Member Avatar for C++NewBe

This is what I have, How would I declare the array based on what I already have? [CODE]#include <iostream> #include <fstream> #include "tempFns.h" using namespace std; int main (void) { // DO: declare an array of type double called temperatures // Use the constant MaxDays for the number of rows …

Member Avatar for YOUSAFZAI
0
121
Member Avatar for calc

Hi, this is my first post. I'll try to keep it short. Basically, I'm trying to solve a one-way wave equation using finite differences. I'm trying to put the values in an multidim. array, where a column represents a time step. The first column is the initial condition. I calculate …

Member Avatar for calc
0
139
Member Avatar for starbucks_life

I am working on the menu of a 3D symbian3 game.I am trying to load a png image of size 91 by12 using GFloat(opengl function) vertices_of_image[ ].....but the text in the image is coming out to be wrapped around. i.e.if my text contains ROCKS...then a portion of the alphabet S …

0
70
Member Avatar for theguitarist

[CODE] int x,y; while(cin>>x>>y) { if(x>y)cout<<x<<"\n"; else if(y>x)cout<<y<<"\n"; } [/CODE] This seems clear,but when I entered this: [CODE]2 4 6[/CODE] and hit enter, I get this: [CODE]4[/CODE] after which I am being asked to enter something again. I put 8, and it prints 8. But what is exactly happening here? …

Member Avatar for WaltP
0
488
Member Avatar for Nor96x

I'm looking for a method of packing all the files of my applications into one archive, and the ability to extract & load them into memory at runtime with C++. I've tried googling it, but I'm not sure if I'm searching with the right criteria because I'm not finding much. …

Member Avatar for vijayan121
0
91
Member Avatar for montjoile

I have this structure: [CODE] typedef struct nodo{ int dato; struct nodo *izq; struct nodo *der; }nodo; typedef struct nodo *avl; [/CODE] I have this method: [CODE] void insertar(avl *r, int dato){ if (*r==NULL){ *r=(nodo*)malloc(sizeof(nodo)); (*r)->dato=dato; (*r)->izq=NULL; (*r)->der=NULL; [/CODE] All this code works perfectly. My question is about the line: …

Member Avatar for montjoile
0
115
Member Avatar for element432

Im trying to have this program continue to run when you enter y or Y at the end or quit when you enter n or N. Everything I try either has it just end or continue to repeat. Any help would be great, thanks! [CODE] #include <iostream> #include <cmath> #include …

Member Avatar for element432
0
170
Member Avatar for thierrypin

I have this problem: I have a data structure called DACT, that I convert into a string line and send to another computer. I have a file full of DACTs, and I need to send them all to another computer. When I send only 100, it works fine, but when …

Member Avatar for thierrypin
0
186
Member Avatar for Muhammad Anas

I just downloaded a document containing some pointers exercises. The statement of One of its questions is as follows: [COLOR="Green"]Write a function that returns a pointer to the maximum value of an array of double's. If the array is empty, return NULL. double* maximum(const double* a, int size); [/COLOR] It …

Member Avatar for Muhammad Anas
0
1K
Member Avatar for Suzie999

How can I get a new line in messagebox? I have two TCHAR arrays, I can print both to separate MB but not both to one This is what I'm looking for (if you can understand what I'm trying) It obviously does not work. [CODE]TCHAR one[] = _T("file\\path\\here"); TCHAR two[] …

Member Avatar for Suzie999
0
423
Member Avatar for pok.kys90

my professor gave a .o file and we are supposed to write a function that links to his file in ssh. his code is struct grades { int lab; int prog; int mid; int final; char name[10]; } void fillArray(grades a[ ], int & num); these two are given and …

Member Avatar for VernonDozier
0
207
Member Avatar for pok.kys90

I am new to c++ and i am supposed to do a test case using my stub with hand calculated mean & standard deviation of number of students that are saved in the .o file in linux. my code is [code] #include <iostream> #include <fstream> #include <cmath> using namespace std; …

Member Avatar for pok.kys90
0
242

The End.