51,593 Topics

Member Avatar for
Member Avatar for scpriya

Q1- This program deals with strings and requires the use of pointers (in a fairly simple fashion). You might consider yourself writing a programmer for a book editor to place a set of index entries into alphabetical order. Some complications arise here in that punctuation in the entries is ignored …

Member Avatar for iamthwee
0
153
Member Avatar for shortLived

<< moderator edit: split thread ([url=http://www.daniweb.com/techtalkforums/showthread.php?t=36591]original[/url]) >> I must have a bad version of Microsofts C++ compiler. When I try the rounding it doesn't work. For example. [code] float salesTotal =6.010002; salesTotal = (((int)((salesTotal*100)+.5))/100.0); // I realize I have plenty of parentheses. [/code] results in a value of 6.010002 stored …

Member Avatar for Ancient Dragon
0
148
Member Avatar for masa

Hi is there anyone have an idea :idea: on how could i get the column 7 from the file, I did it for column 5. or how could I continue to make it take other columns. [code] if ( input_file.fail ()) { cout << "Error opening file."; } else { …

Member Avatar for masa
0
226
Member Avatar for bops

Hi everyone, I recently had to wipe my computer and re-install everything from scratch, including Dev-C++. When I create a Win32 application project and try to compile it, I get a "[Build Error] Error1" message in the compiler log. I know that the code doesnt have any errors in whatsoever, …

Member Avatar for Vzerbo
0
146
Member Avatar for aripaka

Hi All, I would like to know what is the Dev C++ by Bloodshed? In what way is this different from ordinary C++? I read somewhere that this is used to program Windows applications along with the C++ apps. So, is there any tutorial available on web to learn windows …

Member Avatar for Dave Sinkula
0
285
Member Avatar for biggymacdaddy13

I'm in a C++ class right now, and i need some help we're learning about vectors... and we need to know if in a list, of say 3, or 4... can you sort from a certain point, and end at a certain point, instead of just from the begining and …

Member Avatar for Ancient Dragon
0
63
Member Avatar for anant

hi friends ... this is my 1st post ...m sure it gonna be beneficial to me.. wel m facing problem in dis assignment..as m nt dt gud in c++ programmin...pls help me out .....we have to use doubly linked list...n ya if its possible in Borland's C++ Builder6(pro)2005 compiler....as in …

Member Avatar for Dave Sinkula
0
324
Member Avatar for kisvirag21

I need to write a program that inputs an integer and a character, and outputs a symetrical triangle composed of the character that has the interger of new lines. I can only use 'while' loops at this stage of the course, and I know it has to be nested 'while' …

Member Avatar for kisvirag21
0
322
Member Avatar for red

I learned Arrays, Functions, Pointers, Classes and Structures. Now I am ready to move on. My question is, What is the difference between a DLL and an API, and how does one access a DLL in a C++ program? Can someone give an example on how to do it please? …

Member Avatar for Ancient Dragon
0
167
Member Avatar for osean

Can someone who me an example on how to allocate memory in C++? I know I should be using [B]new[/B] instead of [B]malloc[/B] because i'm coding in C++ but I haven't found any simple examples anywhere.. Why i'm asking is because I need to create a function that searches through …

Member Avatar for iamthwee
0
144
Member Avatar for red

Hello, Is there a function that would allow me to check the characters when they key is pressed....before the enter key? I am coding a program that requieres the user to enter only letters (from A to Z && a to z), but I want to check each character when …

Member Avatar for red
0
151
Member Avatar for MaaleaRogers

Perhaps someone can show me how to fix the following example code so either the function outputx() or outputy() is passed to the function print_it(). void do_it(); // prototype void outputx(); // prototype void outputy(); // prototype void print_it( print_character() ); // prototype void outputx() { printf("x\n") } void outputy() …

Member Avatar for MaaleaRogers
0
411
Member Avatar for server_crash

This is my double: double determinant = 2.8*5*-9.5; It should print out -133, right? It prints out some weird junk like: 1.8e + 04 How can I correct this?

Member Avatar for server_crash
0
188
Member Avatar for mybrainhurts

Hi guys and girls, im currently struggling trying to work out all this array and file input stuff! I have been going round in circles for the past few hours, reading books and googling everything i could, so now im hoping some of your intelligence will help me :) Basically …

Member Avatar for Ancient Dragon
0
251
Member Avatar for moznmar

I'm starting to pull my hair out. I'm pretty new to C++, and am trying to fix a loop I have in my code. I have not been able to give the user a way to exit the program unless he/she correctly anwers the multiplication question this program asks. I'm …

Member Avatar for moznmar
0
113
Member Avatar for masa

Hi I would like to know which is better. inialise a value like [code] int i=0; [/code] or like this. [code] int i(0); [/code] and why.

Member Avatar for Dave Sinkula
0
213
Member Avatar for beuls

Dear all, I have written a program in c++ to pass arrays of objects(belonging to the same class) to a member function. It works fine in VC++ but gives an error as "Undefined structure class name". My program is a larger one. So i am giving a similar code below. …

Member Avatar for SpS
0
1K
Member Avatar for DotNetUser

Code in VC++.NET I have a string that has html tags. I want to replace <BR> with \n, but not sure if <BR> will be uppercase, lowercase, or a mixture of both. The string replace function allows only one parameter for the replaced value. Is there a better way of …

Member Avatar for DotNetUser
0
201
Member Avatar for DotNetUser

Anybody know how to create a pop up menu in VC++.NET? In VB 6.0, you would make a call to PopupMenu(menu) with menu visible property = unchecked.

Member Avatar for DotNetUser
0
453
Member Avatar for Jon182

Hey guys, I have been told that the getline function in C++ is a standard library member but is this true as the #include <stdlib> header file does not have to be included in order for getline to work? Thanks.

Member Avatar for Ancient Dragon
0
371
Member Avatar for CPL85

i'm a c++ beginner and now i got a question i try many times but i stil can't solve it so can anyboby here help me to solve? here is my question: Write a program that read in a sequence of characters in terms of sentences. Provide analysis of the …

Member Avatar for CPL85
0
86
Member Avatar for WOTAMod

Don't worry, this isn't a homework assignment :p I've been working on a Half Life 2 modification for a little over a year now. I tried learning C++, I picked up a visual c++ book and it came with a compiler. The book is about 4 inch thick, seems very …

Member Avatar for RedSevenBlue
0
259
Member Avatar for aminura

Can somebody please tell what does this function prototype indicate-- [CODE]const char* fun( char const *,const char*);[/CODE] Is it some thing like that the return type would always be constant char ? And what is the difference in the two declarations-- char const* and const char*? Thanks

Member Avatar for aminura
0
119
Member Avatar for JoBe

Hello ladies and gents, I was just wondering how you would implement this into C if it actually is possible, if not, how do you guys implement an equal way of dealing with this in C ? For instance, if you would have classes like this in C++: [code] class …

Member Avatar for Ancient Dragon
0
140
Member Avatar for coolice

Hi ! I would like ask somebody help. I need to build a very simple application in BCB which can simply record a voice through the microphone. Thats all. It seems to be complicated, but it is fairly simple as it is documented here : [url]http://bdn.borland.com/article/0,1410,28332,00.html[/url] The problem is, that …

0
55
Member Avatar for JoBe

Hello ladies and gents, I hope the moderators won't mind me posting this here, if they do, feel free to move it, but since it is related towards C++, I figured it belonged here ;) A while back I was browsing the GameDev forums and I found this thread in …

0
128
Member Avatar for JoBe

Hello ladies and gents, Wondered if any of you could help me out here, I'm trying to increment an element of a vector of integers. Here's the code: [code] #include <algorithm> #include <cctype> #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<int> scores; scores.push_back(500); scores.push_back(600); scores.push_back(300); …

Member Avatar for JoBe
0
6K
Member Avatar for VTMas

Here's what I'm trying to do: I have a DSN for an Oracle ODBC Connection. My code needs to attempt to read from a file first the connection string, followed by the SQL commands to be executed. All of this I have down already, except for the Database name in …

Member Avatar for VTMas
0
167
Member Avatar for gmv

hi i am doing a project and i would like to know if anyone can please tell me how to write a delay or wait function in c++ which works asynchronously with other programs. :confused: Thank you for ur help. gmv

Member Avatar for Dave Sinkula
0
239
Member Avatar for iamlearning

I would like to create a macro to convert a variable string into the UNICODE (16 bits). Example: [B]#define UNICODE ("xyz") [/B] - It will return 0,'x',0,'y',0, z at compilation time. The size of parameter to the macro can be any length. Thanks for helping

Member Avatar for Rashakil Fol
0
191
Member Avatar for kahaj

I'm trying to create a simple text-based word jumble game. Basically, I'm trying to create a bank of jumbled words. Ppl can try to solve the jumble. If it's right, it will cout something about having it right. If it's wrong, it will cout something about sorry, but it should …

Member Avatar for winbatch
0
185
Member Avatar for srishekh

Respected sir/madam, Will anybody help me in how to use ImadeMagic for color image segmentation. I used the command mogrify -segment 100 1.5 image.ppm it gives the output as a gray scale image. Looking forward for the reply with regards shekh

Member Avatar for Narue
0
56
Member Avatar for mariposa104

Hi. I have to create this program in c++ but I have many problems when I try to create can you help me please. Create a class rectangle. The clas has attributes length and width, each of which defaults to 1. It has members function that calculate the perimeter and …

Member Avatar for iamlearning
0
254
Member Avatar for some one

[CODE]#include <vector> #include <string> #include <iostream> #include <windows.h> using namespace::std; class customer{ private: char type; double balance; public: void check_type(){ if(type=='p'){ if (balance<1000) { balance=balance-2;} else if (balance<1000) { balance=balance-5;} } } }; class Transactions{ private: char type; double amount; int houre; int minute; public: Transactions(char t,double a,int h,int m):type(t),amount(a),houre(h),minute(m) …

Member Avatar for iamlearning
0
123
Member Avatar for osean

Hi, can someone point me to a good tutorial on using the CreateThread and CreateRemoteThread API? I've already read the MSDN documentation for both functions, i'm looking for a site that explains the use of both functions in more detail and provides alot of example code, thanks.

Member Avatar for osean
0
565
Member Avatar for Acidburn

Hello, in 'cpp' code if I wish to include a header file its .H...ie //function definitions are located in function.h . The implementation is loaded in functions.cpp, however some of the functions take parameters created in main. Therefore rather than including the following: [quote] #include <iostream> ... function.h function.cpp ... …

Member Avatar for Acidburn
0
139
Member Avatar for rajuwani121

I have a project in Borland C in which i need to Connect with SQL server 2000 plz give me the code for that.

Member Avatar for SpS
0
300
Member Avatar for Acidburn

Hello I'm having a stuggling implmenting some code...here's what I've got so far: [code] cout << "\n\nChoice" << endl; cin >> choice; while (choice!=0) { switch(choice) { case 1: cout << "Inserting manually..." << endl; // addmanual(); break; case 2: cout << "Inserting from file... "<< endl; cout << "file …

Member Avatar for SpS
0
139
Member Avatar for sam1

hi i want to : 1. view all the books 2. search for a book i have managed to complete part of this . the code is as follow: [CODE] #include <iostream> #include <fstream> #include <assert.h> #include <stdlib.h> using namespace std; const int BOOK_MAX = 5000 ; const int USER_MAX …

Member Avatar for dwks
0
212
Member Avatar for Karl1

What is the best way to use Sine waves in C++? Also, I want to, by inputting sine waves, generate a sound and vice versa. Is there a way to do this?

Member Avatar for dwks
0
47
Member Avatar for sunlight

Hi every body I need to constract a code from this problem This question is based on Unit 2. A motor insurance company has surveyed a sample of its clients. The information on each returned questionnaire includes the following: o whether the client has had a claim in the last …

Member Avatar for dwks
0
123
Member Avatar for atrusmre

If I have a MFC program that opens a socket connection, how would I test to see if the socket has succesfully opened or not?

Member Avatar for atrusmre
0
176
Member Avatar for winbatch

If I've got a vector of strings, is there a quick one liner that gets me the longest (ie .size() ) of the string inside (or conversely, the shortest?) The alternatives I've thought of are as follows, but they all seem inefficient: - Keep a variable of the longest size …

Member Avatar for winbatch
0
4K
Member Avatar for Jon182

Hey guys, I have the following code, but for some reason it does not work with bigger txt files is this because of the size of the array? And if so is there a simple way to solve the problem? Thanks in advance for any help. [code] char ch[1000]; int …

Member Avatar for Jon182
0
236
Member Avatar for bops

Hi, I have recently started windows programming in C/C++, I understand most of it, but 1 thing i cant find out how to do is to put controls on the main window of the application, not in a popup dialog box...can anyone give me any tips on how to do …

Member Avatar for Ancient Dragon
0
552
Member Avatar for Benfried

Hi everyone, I'm beginning to learn about progamming and I'm currently working through the seminal 'C Programming Language' which is excellent, but I have a problem regarding functions. My understanding of functions in C is that they return a value. For example: [code]x = func(a, b);[/code] ...would set x to …

Member Avatar for SpS
0
143
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about Virtual Function in my book and there is this programming that shows how and what happens, I understand what is happening but one thing that came to my mind is that, previously in my book, there was mentioned that you should allways …

Member Avatar for Ancient Dragon
0
786
Member Avatar for tyczj

i have errors and i dont know y im gettin them here is the code. a majority of them are undeclaired idetifyers but they are function calls?!?! [CODE]#include <iostream> #include <iomanip> using namespace std; class Array { public: Array(); Array(const Array& copyFrom); ~Array() { }; void append(int arrayA[]); void chop(int …

Member Avatar for tyczj
0
302
Member Avatar for desiree

SORRY I GOT IT WRONG!! THE YEAR I MEAN!! before i typed it year 2005 and im sorry for that!! and now i correct it!! i tried to solve this problem!! and have a problem in sorting and searching!! hope you can guide me with this problem!!! thanks a lot …

Member Avatar for Ancient Dragon
0
154
Member Avatar for desiree

hello people!! im new here!! please!! help me to solve my problem in programming!! this is the problem: USING C++ *array of class, use struct *create a dynamic array of customers account record with the following attributes: a) account number b)last name c)firstname d)middle initial e)account balance f)status(o-open/ c-close) it …

Member Avatar for winbatch
0
127

The End.