51,593 Topics

Member Avatar for
Member Avatar for dflatt

hi i'm trying to write a program that compares and manipulates certain characters from a string. heres the bit i'm having trouble with. [CODE] char c; if(c <= a && c >= x)//obvious error //do something [/CODE] is there anyway i can get this to check if 'char c' lies …

Member Avatar for dflatt
0
129
Member Avatar for iammfa

Hi, Here is an example made by 'C++' and 'SDL' library, this example load an image with format .PNG, because I'm beginner in c++, I'm asking some questions: [CODE]/*This source code copyrighted by Lazy Foo' Productions (2004-2009) and may not be redestributed without written permission.*/ //The headers #include "SDL.h" #include …

Member Avatar for Ketsuekiame
0
140
Member Avatar for dgr231

Hey everyone, I've been working on learning the Win32 API for C++ so that I can start programming windows programs. I haven't run into any issues until last night when I tried to include a menu in my basic window through resources. I'm using Visual C++ Express 2010 which doesn't …

Member Avatar for mitrmkar
0
252
Member Avatar for keeda

I am using a solaris machine to run my c++ code I have written the following code in the mentioned files classclock.h [CODE] #include <iostream> using namespace std; class classclock { private: int min; int hour; int sec; //member function for the operations public: void SetTime(int a,int b,int c); };[/CODE] …

Member Avatar for mitrmkar
0
82
Member Avatar for younas khan

Write a program that defines a template function named add(). This function takes two arguments, add two variables and then return the sum. In main function, define two variables of type int, two variables of type float and two objects of type ‘String’. Now call the add() function three times …

Member Avatar for amrith92
0
122
Member Avatar for psdao1102

So im in a collage c++ class, and i missed my last class, so my teacher told me to try lab 5, i think i have templates down but im getting a compiler error saying that my function is ambigious.. the exact error is Error 1 error C2782: 'T searchArray(T,T,int)' …

Member Avatar for thelamb
0
83
Member Avatar for nu2cpp

Hi Guys, I am using visual studio 2009 using vc++. I am reading from a text file using a streamReader one line at a time. The data is tab delimited. I am trying to split the data and then stuff all the strings into struct. Here's what I am doing …

Member Avatar for jonsca
0
211
Member Avatar for blovatt

Hello - I need to create a utility using C/C++ to parse information from a XML audit log file that is continuously being appended by a separate process I need to read the information in and process it, then when I reach the EOF I need to wait/monitor for more …

Member Avatar for blovatt
0
97
Member Avatar for maryam ahmad

im a beginner and using C++ 2008 edition and this pow function isnt working on it although its working perfectly ob C++6. please help. THIS IS PART OF THE CODE: [CODE]#include<iostream> #include<cmath> using namespace std; int det (int **oldray,int order) { int deter=0,i,k; int **newray; newray=new int*[order-1]; for( i=0;i<order;i++) newray[i]=new …

Member Avatar for Fbody
0
155
Member Avatar for phummon

Hi everyone, I'm a moderately experienced C++ programmer working on code which must do the following: (a) Import data from a lot of little CSV files (b) Load that data into various objects (c) Do stuff with that data The code I've written does (a), (b), and (c) pretty well, …

Member Avatar for phummon
0
194
Member Avatar for em-kay

Hello FirstPerson First of all, Im not an openGL expert but Im trying to write a code of a movng object and Im facing some problems. So i need your help please here is the code [CODE]#include <iostream> #include <cmath> #include <windows.h> #include <gl/Gl.h> #include <gl/Glu.h> #include <gl/glut.h> double r=600/4,delta=1/r; …

Member Avatar for em-kay
-2
2K
Member Avatar for unity

hi i want some good question c/c++ for practice can anyone suggest me some website or any good book

Member Avatar for suze_eq
0
156
Member Avatar for elexender

Hi all, I want to make a string like this: [QUOTE]SELECT * FROM "Alexander de Groot"[/QUOTE]. So i can later execute that sql statment. Im only having a problem creating the string. Let me show you: [CODE]string sTableName; char *SqlTableName; sTableName = DBLookupComboBox1->Text.c_str(); SqlTableName = new char[sTableName.size()+ 20]; strcpy(SqlTableName,"SELECT * …

Member Avatar for elexender
0
106
Member Avatar for cswenson1

How, in C++, can i convert a video from 1 format to another? Currently the only way i know how is by using an external exe called FFmpeg and using the function [code=c++]system("ffmpeg -i file.avi file.mp4");[/code]

Member Avatar for Narue
0
1K
Member Avatar for mani_singh

hello to all, i am learning c++ and while looking at some code, i came upon this: *(float*) and *(DWORD*). for example [ICODE]#define adress_1 0x00AA8B20 *(float*) adress_1 = 5000000; [/ICODE] so can you explain what the *(float*) and *(DWORD*) do. and i did try and search on google but didnt …

Member Avatar for strmstn
0
108
Member Avatar for f11691

hi please help me.i wrote a program for student now i want rewrite with classes but i dont know how. :( my program: [code] #include<iostream.h> #include<string.h> struct student { char fname[30]; char lname[30]; long ID; float avg; };typedef struct student t1; void getinfo(t1 s[],int n) { int i; for(i=0;i<n;i++) { …

Member Avatar for Aranarth
-1
208
Member Avatar for carrythe1

Hi, I am new to this website (and C++) so pls forgive any newb errors / convention mistakes. I have a project that contains both a normal source file (PB.cpp), associated header (PB.h) and a windows form (GUI.h). I'm trying to pass a variable from the form to a function …

Member Avatar for finito
0
168
Member Avatar for rohitn

Hi, I want to perform find and replace (like the one in MS word) on a group of files. Can somebody guide me on how to do that using regular expressions?is there any tool available to automate such task for any number of files? Thanks in advance.

Member Avatar for kbshibukumar
0
46
Member Avatar for jimJohnson

I am going some exercises and just want to make sure I am doing it right. It says for the following...Assume StackType is sent to int and STACK_CAPACITY is set to 5. Give the values of myTop and the contents of the array referred to by myArray in the stack …

Member Avatar for chiwawa10
0
134
Member Avatar for Dewey1040

I'm trying to create a menu using ncurses, I found some useful code and help online, but the code has errors in it. And I can't figure out why I'm generating this error. On top of all this, theres no way I'll be able to use the information I've found …

Member Avatar for Dewey1040
0
116
Member Avatar for codecx

I'm almost done making a 2D game (and yes I'm sorta a newb) and I still haven't figured out how to delete an entity. Instead, as a place holder, I set the texture path to "" and all the variables to 0. I am using a class and here is …

Member Avatar for codecx
0
155
Member Avatar for niemo

hi all, I'm trying to make a C++ application that visualizes the computer structure (drivers, folders and subfolders, ...) in a 3D tree. I want to access my hard disk to get its structure and use it. How can I do so?? Is there a look-up table or something that …

Member Avatar for Narue
0
216
Member Avatar for mailsadiq
Member Avatar for Buttacup

I've been doing research on how processes communicate for the past like 4 months and I still can not answer this very simple question, how do most present day applications communicate within their own framework? Which tends to get me asking another question, do application programmers still program using C++? …

Member Avatar for Buttacup
0
191
Member Avatar for Ja14

This is as much of a question about algorithm as it is about code. I’m training monkeys to input data into a keyboard in the form of a table. I have created a special keyboard with nothing on it but numbers 0 - 9, a period, tab key and a …

Member Avatar for Ja14
0
130
Member Avatar for ssmg

Hi everyone, How do I make sure that user input is of integer data type. not char nor alphanumeric..? when the user inputs character string or alphanumerics it should output "Please enter an integer" Is there sopme wayh to do this? Thanks.

Member Avatar for hypernova
0
432
Member Avatar for Moody_1

Consider all the sequences with length (0 < N < 44), containing only the elements 0 and 1, and no two ones are adjacent (110 is not a valid sequence of length 3, 0101 is a valid sequence of length 4). Write a program which finds the sequence, which is …

Member Avatar for Narue
0
88
Member Avatar for daniel88

Hi guys, Well, I am currently taking a C++ course focusing on learning about object-oriented design concepts, including polymorphism. The assignment I am currently working on involves the creation of a point-of-sale system. The details of the problem are quite involved and challenging (for me, at least!). I am determined …

Member Avatar for daniel88
0
163
Member Avatar for noobday

I've been trying to use member functions from a class (prototypes define in counter.h) in my main file. The class implementation is in file counter.cpp and i am trying to compile countertest.cpp. The error message is : g++ countertest.cpp Undefined symbols: "counter::counter()", referenced from: _main in ccmTnGJX.o _main in ccmTnGJX.o …

Member Avatar for daviddoria
0
153
Member Avatar for yongj

I know that the .txt file is being opened correctly, however, I don't know why the getline function is not storing the first line and outputting it correctly. [CODE]//Joseph Yong //CSC2430 //Homework 7 //Main File #include <iostream> #include <fstream> #include <string> #include <iomanip> #include "Customer.h" using namespace std; Customer cust; …

Member Avatar for Ketsuekiame
0
151
Member Avatar for Sandhya212

Hi, I have code as follows wherein I pass a 2D array to a function and want to receive this array with its contents tripled. [CODE]#include <iostream> #include <cstdio> using namespace std; int** test2 (int arr2[][4],int mul){ for (int i=0;i<2;i++){ for(int j=0;j<4;j++){ arr2[i][j]=arr2[i][j]*mul; } } return arr2;//sending back the address …

Member Avatar for Sandhya212
0
460
Member Avatar for schoenfelder.p

I'm trying to teach myself classes. I decided to create a class to represent a date. It's more for me to learn than to actually be useful. When I have the variables month, day, and year under private setting, the program will not compile (I am using Dev C++). When …

Member Avatar for Ketsuekiame
0
149
Member Avatar for sparkle_jam

Hi guys, I'm having a few problems with my code. I run the program and input 10 users for my account system, but when I try to recall the values for any account, I can only call the first balance I entered. I've been looking at the code, trying to …

Member Avatar for sparkle_jam
0
129
Member Avatar for Sargam541
Member Avatar for Euphan

The queue class needs to inherit protectedly from the list class My code won't compile because of this line towards the bottom listPtr = &myqueue; if i comment out this line, it compiles and runs, but without this line i can't do what i want. I need this line to …

Member Avatar for griswolf
0
170
Member Avatar for kashimushi

My Question: I have created a text file named it kashif.txt and i have placed this file in the same folder where .exe and .ccp of this program is placed but file is not opening. My code is as under. #include <fstream.h> #include<iostream.h> main() { char name[100]; char sal[100]; char …

Member Avatar for chiwawa10
0
87
Member Avatar for kaiyo90

I need a Huffman code can run.Thank You a lot I need a Huffman code can run. I was looking on google but my English is limited and can not find exactly.

Member Avatar for Ketsuekiame
-1
141
Member Avatar for ranit
Member Avatar for griswolf
0
667
Member Avatar for randy03

i am currently new to c++ coding and i have been working on this code for a class, i am suppose to get emails from a .txt file and the program reads each line of the file analyzing each and every char of every line to see if it is …

Member Avatar for iamthwee
0
2K
Member Avatar for Leppie

Mucking about (should say practising what I've learn't), and made my version of the rabbits practice program. It's not totally finished but it's my first draft and it's working. Before continueing, I'd like a code review please to tell me whats not correctly done or how I could improve my …

Member Avatar for Leppie
0
116
Member Avatar for Martje

I have my class in 2 different files(header and source-file) and i have 2 variables which is a const but the only way to give the const variable a value is to do it trough an constructor initializer. But how do i implement an constructor initializer in my class ? …

Member Avatar for mrnutty
0
85
Member Avatar for new2programming

hi i want to give my sprites some weapons- one a gun and the other a sword but i have no idea what i am doing, can anyone help me do this please? i've included my main.cpp, player.cpp and player.h if it helps.. im using visual c++ and SDL and …

Member Avatar for new2programming
0
149
Member Avatar for edbirdmann

I am writing the following program that calculates the average of a group of test scores where the lowest score in the group is dropped. It has the following functions: void getScore()-should ask the user for a test score, store it in a reference parameter variable, and validate it. This …

Member Avatar for schoenfelder.p
-1
460
Member Avatar for katmai539

Hello, i'm new to daniweb and also quite new to C++. I'm trying to write a function that takes a filename and a string query like [CODE]string GetStringValue(string filename, string query) { /*...*/ }[/CODE] then finds the query in the file, and returns what's behind the = mark. the file's …

Member Avatar for katmai539
1
210
Member Avatar for bobbyg118

I have tried to start this program but I am so confused with dealing with strings. If any one could take a look and tell me if im on the right path it would be greatly appreciated. Heres the problem and what I have so far: An organization wants to …

Member Avatar for mrnutty
0
104
Member Avatar for anuragcoder

I have made the following code to find a string in some lines of text But it always mentions the error: no matching function for call to 'strcmp(std::string&, std::string&)' [CODE]#include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; int main(){ cout << "Please enter some text" <<endl; string …

Member Avatar for anuragcoder
0
655
Member Avatar for randy03

i am currently working on a program that validates email addresses. i have finished the code to open the user file and read every line in the file and processes every characater to check if there is one "@" and a "." then prints to the console. i am now …

Member Avatar for Lerner
0
106
Member Avatar for donny008

Hello all I am a beginner in image processing and would like to know how i could get the coordinates of an image which is displayed in a window. I work on the visual studio platform to implement my c++ codes. Could someone help me with this please Thanks in …

Member Avatar for daviddoria
0
60
Member Avatar for smkdude

Hello, I am in the process of writing a board game, and part of that game involves having a user click on a hexagonal tile, and when they do and certain conditions are met, the tile should change color to match the player's color. Below is a sample program which …

0
89
Member Avatar for aaronmk2

I want to print out the letter B, instead I get a blank line. Any tips would be great [CODE] #include <iostream> using namespace std; void add(string n); int main() { string B; add(B); } void add(string n) { if(n.length() <= 1) { cout<<n[0]<<endl; } }[/CODE]

Member Avatar for aaronmk2
0
85

The End.