49,761 Topics

Member Avatar for
Member Avatar for acardiac

Can anyone tell how really these functions work???? 1.cin.ignore() 2.cin.clear() 3.cin.good() 4.cin.fail() 5.cin.bad() 6.cin.eof() I mean to say what values these functions return at what situation... thank you! I also need to know about some user input validation techniques.i.e. the user inputs valid data in the programs.....e.g.if there is some …

Member Avatar for rudasi
0
124
Member Avatar for cppStudent

Hi This whole pointer thing is getting the better of me. first i have a call to method "convertToCString" in my main: [CODE]int value = 21; char* cstr = NULL convertToCString(value, &cstr); printf("\"%s\"\n". &cstr); cstr = NULL delete cstr;[/CODE] the method looks like this [CODE]bool convertToCString(int& refConstInt, char** ptrtoCharPtr) { …

Member Avatar for Salem
0
88
Member Avatar for smithss

Hi Guys, i wrote a program that starts another thread. In one case i thought that i have introduced a memory leak and i should get a segmentation fault but i didn't !! That's kind of puzzled me so i decided to post it here. [code=c++] #include <iostream> #include <windows.h> …

Member Avatar for Salem
0
144
Member Avatar for Carmen Smith

Hi, I am working on a project that involves a simple stimulus-response agent which much navigate it's way around a 2d grid world. Does anyone have any good ideas for ways to implement the agent's visual field? The input is a string of characters, one of them representing the position …

Member Avatar for Carmen Smith
0
78
Member Avatar for FEARmike21

Hi, I just started my C++ class a couple weeks ago and I am stuck and having a really diffcult time understanding which commands to use in my programs. I don't even know where to look to get a list. Anyways, basically what we have to make our program do …

Member Avatar for rudasi
0
93
Member Avatar for Argo54325

Ok, something very wrong is going on with my program. When i run it the numbers it is giving me are sometimes right but are also wrong. H (the first letter in the word) is both = to 0 and 1 (wtf?). Any ways below i'll show you want i …

Member Avatar for VernonDozier
0
1K
Member Avatar for rmlopes

Hello all, I am trying to use the #if directive to compile extra functionality acording to some class template parameter defined integer constant. What I want to do is this: [code=cpp] struct A1{ static const int _AINT = 0; }; struct A2{ static const int _AINT = 1; }; template< …

Member Avatar for siddhant3s
0
211
Member Avatar for FEARmike21

I am trying to get a program working, and im half way there, I think. What the program must do is take input from the keyboard and then capitalize every first letter of every word. Here is my entire program so far... [code] #include <stdio.h> #include <iostream> using namespace std; …

Member Avatar for siddhant3s
0
146
Member Avatar for kartheepanmirra

Hi i have a requirement where a cpp file should load a dll viz gzip.dll.then the cpp should call few methods in the dll.well im able to call the methods with no parameters but im unable to call the methods with parameters.if im trying to call methods with parameters i …

Member Avatar for kartheepanmirra
0
451
Member Avatar for mohammad8065

Hi !!!! I want to write a program that print the character # like a triangle in the middle of the page.I mean like this : # # # # # # # # # # # # # # # # # # # # # # # # …

Member Avatar for siddhant3s
0
256
Member Avatar for C++.java

// Sum of Squares and Cubes.cpp : Defines the entry point for the console application. // [code=cplusplus] #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int n,j; cout<<"Enter a Number:"; cin>>n; for(j=1;j<=n;j=j+1) cout<<j*j<< " "; cout<< endl; int a,b,c,sum; a=n+1; b=2*n+1; c=n*a*b; sum=c/6; cout<<"the sum …

Member Avatar for siddhant3s
0
173
Member Avatar for lil_panda

Is there a way for me to use an obj-C class with my C++ program? If so, what special parameters do I have to specify during the compilation phase, and if I needed, changes to my source code files?:-/

Member Avatar for ArkM
0
167
Member Avatar for siddhant3s

I have read prior post on the forum but I came up with few specific questions about Porting Unix Socket(hereby calling it BSD socket) to Win32 Platform : First of all, I am a native Linux C/C++ Programmer. I program in Ubuntu with GCC. But, I usually also port my …

Member Avatar for siddhant3s
0
1K
Member Avatar for arussell817

Hello, I looked around and saw similar problems, but None of the answers seemed to help my situation. Im almost done with my HW Just have come across this minor bump. The error is in the title, and is happening in my addressEntry header, or cpp. not sure: : error …

Member Avatar for siddhant3s
0
447
Member Avatar for jeevsmyd

Hi friends.. Last day at school my teacher gave the following code.. But it is not working.. 16 errors.. I am a beginner in C++ .I badly need your guidance a help in finding the errors... the for loops is all wrong.. To be frank I don't understand the working …

Member Avatar for siddhant3s
0
366
Member Avatar for mikemea

[B]cannot convert parameter 1 from 'char' to 'char *'[/B] calcCharges(type_of_gas, &rate_of_gas, number_of_gallons, &total_gas_of_price, car_wash, &price_of_car_wash, &total_cost);

Member Avatar for ArkM
0
75
Member Avatar for rickster11

Ok, stuck on homework. The program is supposed to read a list of presidents from a binary file and display them. I have it all working..except..when it gets to Truman...it just keeps repeating his information. I know its still going in the loop, but for some reason the pointer stays …

Member Avatar for rickster11
0
143
Member Avatar for shamila08

hello, dear all. below is my program code. the problem is an half of my output is zero for entries of matrix for n greater than 4. [code=cplusplus] #include <stdio.h> #include <stdlib.h> #include <iostream> #define MAX 100 int num[MAX][MAX]; int n; int nrows = 0; using namespace std; void print(int …

Member Avatar for shamila08
0
142
Member Avatar for Yersey

Hello, I am fairly new to C++ and am having a bit of trouble reading in a text file to my program which contains numbers(integers) and names(strings) and checking for spaces in the names(strings).I basically am reading in a .txt file which contains numbers and letters. In this file, the …

Member Avatar for Ancient Dragon
0
167
Member Avatar for crewxp

When declaring get_color and get_size, my compiler gives me errors, and I don't know how to solve them. It's probably something really simple, but I think the more I try at it, the more messed up my code becomes (hence the 'this' and '->' references) marble.cpp(11) : error C2143: syntax …

Member Avatar for Rashakil Fol
0
158
Member Avatar for dvsConcept

Im writing my final project and i have everything in one .cpp file and i was wondering if someone could tell me in detail how to go about putting things in their own file and leaving the main function by itself in the main file. for example i have some …

Member Avatar for dvsConcept
0
100
Member Avatar for Argo54325

Ok so i made a decoder for this that gets the letters from the numbers that this encoder gets. Problem is that i think the numbers its giving me are wrong and i can't seem to figure out whats causing the problem. Help please! :( [CODE=C++]#define _CRT_RAND_S #include <iostream> #include …

Member Avatar for Argo54325
0
104
Member Avatar for StainlessSteelR

This is what I'm suppose to do: "Create a while loop to read in the corporate sales data from the pgm3.dat file and create a report listing data for each division as well as some of the summary data described in Programming Challenge 12 in the textbook. Inside the loop, …

Member Avatar for Ancient Dragon
0
118
Member Avatar for cppStudent

Hi [CODE]int** numberLists = new int*[count];[/CODE] I'm having difficulties understanding this line of code, I've just started programming in c++. I think I got the basics of pointers but I can't find any helpful "enough" info about arrays of pointers. I understand that an array of pointers to integers is …

Member Avatar for death_oclock
0
144
Member Avatar for gyagyus

Hi! I wrote two functions in order to access two private data members of a template class and I got the messages in the title every time I call these functions(getNcols(), getNrows()). I'd be very grateful for your help, guys... (Without the "template<class T>" before the friends, I got linker …

Member Avatar for gyagyus
1
235
Member Avatar for Argo54325

When i runt he code and try to get the size of the 2 files something goes wrong with the msgIn file. I'm using the same method for both files and the bookIn will work but msgIn just returns 0 as if it never ran. this is the method that …

Member Avatar for Salem
0
136
Member Avatar for bradbobak

Hi, does anyone know what the message 0xc088 is? My PeekMessage(...) loop is getting this message code, but I cannot find it in the header files (grep'ed c088). It seems to be intersperced with WM_PAINT messages.

Member Avatar for William Hemsworth
0
61
Member Avatar for scrypt3r

Im trying to get my program to list certain types of drives etc but i dont know all the drive type names like "DRIVE_REMOVABLE" or "DRIVE_CDROM". does anyone have a list of the entries?

Member Avatar for Yiuca
0
109
Member Avatar for Argo54325

I'm trying to get a char back from the bookFile.txt but, when i run the program it returns nothing. I'm not sure if .get() if the right thing to be using. When i run this code i get the random number and the first letter of the msgFile.txt returned correctly. …

Member Avatar for nucleon
0
184
Member Avatar for fusi0n423

I have a project where I have to analyze 3 different hashing functions. I cannot get the cyclic shift hash to work with a bitwise OR. Everything looks fine to me am I doing something wrong? [code=cplusplus]int Hash::hash(string key) { unsigned int h = 0; for(int i =0; i < …

Member Avatar for nucleon
0
280

The End.