51,593 Topics

Member Avatar for
Member Avatar for jaepi

Hello there, do have any idea if there is a function that gets wchar from the stream, somewhat similar to fgets function. Thanks. :)

Member Avatar for jaepi
0
148
Member Avatar for jaepi

Hello there, is there a function in Linux that can handle the reading of an .ini file? Thanks.

Member Avatar for jaepi
0
1K
Member Avatar for qcwailun

I want to write a code for recording inventory item, all the functions work fine except the function for removing the data. I spend a lot of time in it but still cannot know what's wrong. Here is my code: [code=c++] #include <iostream> #include <fstream> #include <vector> #include <string> using …

Member Avatar for Ancient Dragon
0
284
Member Avatar for kaly12

This is a part of a c++ program: cout<< "Width:" << Width << "\n"; cout << "Length: " << Length << endl; what does the "\n" do in oppose to endl; ? also, when do you use void main instead of int main at the beginning of the program?

Member Avatar for invisal
0
95
Member Avatar for spankyg

Can someone please explain to me just exactly this try/catch is doing? It doesn't seem to make any sense to me. Thank you in advance. case '\r': if (Choice==(CancelIndex+1))return; try{(*Action[Choice-1])();} catch(...){} system("cls"); Choice = 1; break; case char(27): if ((CancelIndex+1)==ItemCount)return; try{(*Action[ItemCount-1])();} catch(...){} Choice = 1; break;

Member Avatar for spankyg
0
124
Member Avatar for Kattalyst

A College offers a course that prepares students for the state licensing exam for real estate brokers. Last Year, several of the students who completed this course took the licensing examination. Naturally, the college wants to know how well its students did on the exam. You have been asked to …

Member Avatar for Kattalyst
0
94
Member Avatar for guitarrick

I posted this one earlier, but no go......I'm getting an error for the constructor definition StudentRecord::StudentRecord() that it cannot return a value. This was running until I did some rearranging to try to get my function that calculates the total grade average in main to work.(So i commented that all …

Member Avatar for guitarrick
0
94
Member Avatar for r5ingh

Hello. I, the C++ noob is back again... This time requiring some help with some visual CPP. This is the first time im working with this, and its only @ a basic level. Yes, this is somehting im doing at university, but i dont ask for help unless im stuck …

Member Avatar for r5ingh
0
238
Member Avatar for volia

Hi guys, I'm new the site, in fact just stumbled on it looking for some help with some C++ strings. I'm taking 1400CS and well, to be perfectly frank, I'm not good at it. This is alright, I'm more of a VT person myself, but I have this and another …

Member Avatar for Narue
0
69
Member Avatar for comput_novice

i have a task how to link two files to read from oneanother like a search this is what i have please help this is urgently needed ofstream outfile; fstream myfile; outfile.open("Inventory.txt"); myfile.open("Invoice.txt"); outfile<< "\n\nWELCOME TO THE INVENTORY\n"; outfile<< "========================\n"; outfile<<"Item ID"<<setw(10)<<"Name"<<setw(16)<<"Descrition"; cout<<"Please fill in the following information\n\n"; cout<<"Item ID: …

Member Avatar for Salem
0
99
Member Avatar for kv79

Hi to all ,just a small question. When i read in the book for Win32 API tur. in c++, this: " cbSize The size of the structure. " I asked my self ,what sturcture? I tought we useing class.

Member Avatar for kv79
0
115
Member Avatar for __vmware__

Hello, I have problem witch i've been working on for a couple of days now with no real progress. The problem is that i'm trying to search trough a array of pointer for a certain value. If the value exist return that value to be used in another function, but …

Member Avatar for __vmware__
1
109
Member Avatar for eranga262154

Hi all, I have a string(not a CString), actually a file path. As an example, [CODE]c:\Test\MyProject\G00062_002_01.srf[/CODE] Then in following way get some data. [CODE] string FullPath = c:\Test\MyProject\G00062_002_01.srf string filePath = FullPath.GetFileTitle(); string groupID; string sessionId; string partID; groupID = filePath.substr(1, 5); sessionId = filePath.substr(7, 3); partID = filePath.substr(11, 2); …

Member Avatar for Duoas
0
115
Member Avatar for danbellinger1

I am working on a project using 2D arrays ( I have never really understood the use, I know how they work, just have always had problems implementing) that holds a 4x4 "magic square." Magic squares contain unique numbers whose rows, columns, and major diagonals add up to the magical …

Member Avatar for Lerner
0
171
Member Avatar for 3nCrypti0n

Im making this program. But im having trouble calling certain functions. Im having trouble calling ShellExecute, RemoveDirectory, CreateDirectory, FindFirstFile, & DeleteFile. I get the following errors when trying to compile... [CODE] c:\documents and settings\george\my documents\visual studio 2005\projects\mmpc v1.0\mmpc v1.0\prog.cpp(42) : error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const …

Member Avatar for Duoas
0
231
Member Avatar for alcoheca

Hi, Despite triple checking my code for duplication and checking that the headers include #ifndef I still can't trace what is causing this error message: drawscr.o(.bss+0x0):drawscr.cpp: multiple definition of `massage' main.o(.bss+0x0):main.cpp: first defined here Ideally I'd create the pointer at struct definition time via a declarator. [CODE=C]// drawscr.cpp #include <iostream> …

Member Avatar for Duoas
0
288
Member Avatar for guitarrick

Hello again everyone. This one is a project to help with understanding another project (aren't they all?)... At any rate, this was running up through main where I was attempting to call and get my grade computation function (which you'll see a bunch of stuff commented out). I fooled around …

Member Avatar for guitarrick
0
114
Member Avatar for finalheavenx

help me make this shorter.. i think this is too long.. i'm a newbie student.. #include <iostream.h> #include <conio.h> int main() { int x, n=0; clrscr(); for(x=1;x<=5;x++) cout << " " << x; if(++n==5) { cout << " " << endl; } n=0; for(x=2;x<=5;x++) cout << " " << x; …

Member Avatar for WaltP
0
125
Member Avatar for kittycat07us

Hi. I was wondering if someone could help me with this program.. the purpose of this program is to play tic tac toe, and I'm having difficulty getting it to compile. I have gone through it several times. I would most appericate it if anyone could look at it and …

Member Avatar for Ancient Dragon
0
89
Member Avatar for kv79

Hi to all, just a small question? This is typed in the book. hInstance is used for things like loading resources and any other task which is performed on a per-module basis. What is pre-module basis. Google won't help.

Member Avatar for kv79
0
93
Member Avatar for lacy1104

I am working on a project in which i have to use Classes and do multiple things with different sorts of data. The basic question i have though is this: what am i doing wrong here in terms of this class declaration etc...i get ton of errors and cant seem …

Member Avatar for Ancient Dragon
0
292
Member Avatar for Underdog67

I'm having a lot of difficulty trying to figure out how to label headings in a 2D array using enum type. Here is the basic for-loops to read in and out the values of an array. (This is a 5x5 array). [CODE] #include <iostream> #include <fstream> #include <iomanip> #include <cstring> …

Member Avatar for Duoas
0
2K
Member Avatar for ferrari77

#include<string> #include<iostream> #include<fstream> using namespace std; class fileHandleString { private: ifstream infile; ofstream outfile; public: fileHandleString() { infile.open("input.txt", ios::in); outfile.open("output.txt", ios::in); } ~fileHandleString() { infile.close(); } string getFromFile() { string str; getline (outfile, str); return (str); } }; The above code is what I am using but I keep getting …

Member Avatar for Duoas
0
516
Member Avatar for ENG ISE student

I am getting an error i dont recognize and dont know what to do to fix it and input would be great. The error is: [CODE]prog4.cpp:23: error: no matching function for call to 'std::basic_istream<char, std::char_traits<char> >::get(char [500])'[/CODE] [CODE] #include <iostream> #include <ctype.h> #include <cstring> using namespace std; void encrypt(char ch, …

Member Avatar for Ancient Dragon
0
100
Member Avatar for raj1

I am using a for loop to calculate the distance between the vertices of a polygon using for (i=0; i<N, i++) { j= (i-1) result = sqrt (sqr(X-X[j])+sqr(y-y[j])); } return result; This work fine however it doesn't and I cant calculate the distance between the last and first vertice e.g …

Member Avatar for raj1
0
112
Member Avatar for tiffy1012

I am having a hard time getting this program (my homework assignment) to compile. I have looked it over a million times. The program is supose to read an inventory of an art gallery from "art.dat" into a struct (the Type and Place have to be enum types), and then …

Member Avatar for vmanes
0
122
Member Avatar for yuzhang

Hello All: I have been thinking to learn develop a GUI using C++. Any suggestions on where to start? (Using which development kits and etc) Thank you

Member Avatar for maddog39
0
87
Member Avatar for balla4eva33

I have this code: [code] void ShapeArr::publishStats() { double ap = 0.0; for (int i=0; i < currCount; i++) { Shape *s = arr[i]; ap += s->getAPRatio(); } cout << "Max APRatio = " << [COLOR="Red"][B]???[/B][/COLOR] << " Average APRatio = " << ap/currCount << endl; } [/code] What do …

Member Avatar for balla4eva33
0
118
Member Avatar for np2100

I am still a beginner, I recently started learning C++. However I am writing a program that converts currencies. For example Dollars to Euros. However when I have them pick the number of the currency they want to convert the number 2 doesnt work. Here it is: [CODE]#include <iostream> using …

Member Avatar for np2100
0
309
Member Avatar for kararu

Hi all, Can anyone suggest me commands which will take a given thing and execute it in the command line and return the output. system() doesnt suit me bcos 1.it returns int not entire output 2.it opens command line window(shell) ( I dont want to open the window or display …

Member Avatar for hkdani
1
120
Member Avatar for finalheavenx

Hello I'm a newbie c++ student, I would like to ask how can I get this kind of program output by using c++: [B]10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 …

Member Avatar for Salem
0
352
Member Avatar for rlwright12

I am trying to take the following code so that my bottom function first pulls out the first three scores of a text file and averages them, then pulls the last three scores out and averages them. I am using a known good text file that has 7 entries with …

Member Avatar for WaltP
0
97
Member Avatar for wijitha

hi ..... can any one help me how to change logger level of ACE framework loggers. wijitha

Member Avatar for Ancient Dragon
0
175
Member Avatar for yeah

hi friends I tried to link c++ object files using "bfin-elf-ld" and got some undefined reference errors Errors::::: (.text+0x2ee8): undefined reference to `operator delete(void*)' (.text+0x2ef4): undefined reference to `_Unwind_Resume' (.text+0x2efa): undefined reference to `operator new(unsigned long)' (.text+0x25f6): undefined reference to `__muldf3' (.text+0x2620): undefined reference to `__floatsidf' I dont know why …

Member Avatar for Salem
0
126
Member Avatar for dammest

Write a program that counts the number of occurrences of selected words in standard input. Remarks: • The selected words are given as command line parameters. • The program should print out the words with their number of occurrences. Use following definition: typedef struct { char * word; unsigned int …

Member Avatar for Ancient Dragon
0
71
Member Avatar for pdhbaseball23

I have to use arrays to calculate some statistics on a set of data. The example of the file looks like this: 6 5 1 3 2 4 3 4 2 4 2 1 2 3 5 6 8 5 6 9 4 3 1 5 7 3 7 2 …

Member Avatar for pdhbaseball23
0
105
Member Avatar for twooften

I have been trying to figure this one out for a while, so please don't laugh. I know it is a little messed up. I didn't include the whole code, if necessary I will post more. The line indicated is giving me a "cannot convert from 'HGLOBAL' to 'int *' …

Member Avatar for ithelp
0
236
Member Avatar for pdhbaseball23

I have to use arrays to calculate some statistics on a set of data. The example of the file looks like this: 6 5 1 3 2 4 3 4 2 4 2 1 2 3 5 6 8 5 6 9 4 3 1 5 7 3 7 2 …

0
61
Member Avatar for DamiLeon

Hi to all, I am new to this C++ world I have kind of a quick question. I need to do a modified selection sort that can handle characters. I know how to do one but only with integers (see code below). Any help or suggestion as to how I …

Member Avatar for Ancient Dragon
0
99
Member Avatar for Marks256

I am still starting out with c++, but i like tackling complicated tasks when i learn. I have a project in mind that requires me to play MP3s. Since i will be doing MOST of the code in c++ (at least that is what i plan at the moment), i …

0
62
Member Avatar for balla4eva33

Maybe my other thread was too wordy for everyone, cuz I usually receive help right away, and I see that it was viewed 20+ times and yet no responses...so basically I need help with my homework...We were given a main.cpp file, and PART of a header file. He also gave …

Member Avatar for balla4eva33
0
97
Member Avatar for FireSBurnsmuP

Great, more iterator trouble. First we have an iterator of any value. I want to make a second iterator that starts one higher than the first one. Look-see: [code] for( iterator_type one ; /*...*/) { for( iterator_type two = one + 1 ; /*...*/) { /*...*/ } }[/code] That's the …

Member Avatar for vijayan121
0
141
Member Avatar for FireSBurnsmuP

Alright, here's the code: [code] for ( map<string,int>::iterator word = mostUsed.begin() ; word != mostUsed.end() ; word++ ) [/code] and the error by g++ - (using make) [code] error: conversion from 'std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >; int> >' to non-scalar type 'std::_Rb_tree_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >; int> >' requested[/code] Okay... …

Member Avatar for FireSBurnsmuP
0
447
Member Avatar for guitarrick

I'm missing something really basic on this one I'm sure. We have to write a program using a class Odometer, that will track fuel and mileage of a car. The member functions are given: one to set fuel efficiency, one to accept total miles driven and add to the odometer …

Member Avatar for Duoas
0
98
Member Avatar for guitarrick

Of all things, I can't seem to get my do while loop to work. I have a running program, but get a[I] syntax error : identifier 'choice'[/I] Can't see it, any help greatly appreciated RG [CODE]#include <iostream> using namespace std; class Odometer { public: Odometer(); void reset(); void compute_fuel(); void …

Member Avatar for guitarrick
0
128
Member Avatar for johny112

Hi all, I have written a programme, but when it prints the results , it doesnt print £ sign [CODE]cout <<"Salary is £ "<< salary_without_overtime<<endl;[/CODE] Instead it prints u="U" with a funny bar on top. Now im very new to c++ but i do know basics, can someone please tell …

Member Avatar for iamthwee
0
88
Member Avatar for clockscan

Hello, I am hoping to get some code for the following problem I need to verify that a user input the time in the following format: cout<<"please enter the start time(hh:mm:ss): "; cin>>stime; //Verify user input time correctly cout<<"please enter the end time(hh:mm:ss): "; cin>>etime; //Verify user input time correctly …

Member Avatar for Narue
0
89
Member Avatar for adypan06

can somebody please help me out in writing matrix 10*10 matrix program. thanks in advance

Member Avatar for adypan06
0
50
Member Avatar for sarahger9

I am trying to generate a random vector of integers and sort them using merge sort. I am having trouble with the code. It is long, but I would appreciate if someone could take a look at it and see if the can help me, I've been working on it …

Member Avatar for Ancient Dragon
0
105
Member Avatar for ENG ISE student

This is a fairly simple program that basically reads in a phrase from the user, then a number. The number is used to encrypt the data. For every character read in it adds 1 to it, then the second number it adds 2 to, then third 3 and so on …

Member Avatar for Duoas
0
94

The End.