49,761 Topics

Member Avatar for
Member Avatar for kylcrow

Hey guys, I am having issues understanding how exactly to mod something to avoid overflow. say i have this hash function: [CODE=c++] int universalHash(const string &x,int B) { long long sum; long long power; sum=0; pow = 1; for (int i=0;i<(signed)x.length();i++) { // cout << "sum= " << sum << …

Member Avatar for ArkM
0
166
Member Avatar for dagiwal
Member Avatar for dagiwal
0
33
Member Avatar for ashishchoure

hi , can anyone tell how to define AND operator by regular expression. Actually I want to return match if and only if 2 substrings will appear in string. For example i have string "[B]Successful Logon: User Name: Administrator Domain: Logon ID: (0x0,0x154CB759) Logon Type:2 Logon Process: Advapi Authentication Package: …

Member Avatar for ArkM
0
333
Member Avatar for omarzia88

i am new to c++ programing.can anyone tell me how to draw a line from a point to another point. if the coordinates of the points are given.in (x,y) please also tell me the header files which should be included in program. your comments will be highly appreciated.

Member Avatar for ddanbe
0
137
Member Avatar for Takafoo

int main( int argc, char *argv[] ) { ==> This function has over 60 lines. You need to split it into smaller functions Everytime I try to split it up I just cause errors (it compiles but locks up when I run it through the test system so I think …

Member Avatar for Takafoo
0
177
Member Avatar for Rickenbacker360

Hey, it looks like I'm stuck yet again. I've been working on this for awhile and I can't figure out why it's not working properly. Here's what I'm supposed to do: Create a function that simulates coin tossing. The function should have no input and no return value. When the …

Member Avatar for Somegamer
0
452
Member Avatar for theashman88

Hey I'm working on this program that tests you on a few questions. I enter the answer to one and it comes back and displays correct. For some reason though when the next question comes on it already comes back with a response saying the answer was incorrect. Here's the …

Member Avatar for theashman88
0
99
Member Avatar for goyofoyo

hey I have been looking up shapes in c++ but everyone talks about needing certain compilers and #includes but i don't have those compilers i have just been using the standard Microsoft visual studio at my school i think and my teacher has just asked us to create different shapes. …

Member Avatar for Ancient Dragon
0
117
Member Avatar for vinodmenon80

Hello I need some help with this question. I have attempted to write a segment of code for the Binary Search Trees in C++ code. Refer to the question below. Design and implement a program in C++ to solve the following problem. DESCRIPTION This program, which learns by asking questions, …

0
46
Member Avatar for DarthPJB

I'm continuing my project and found a strange error, I can think of ten thousand hacks to get around it and a few ways to fix it properly, but my curiousity is peeked. why Is AStringBufEx end result 18 characters long when the Lenth of the initial string is only …

Member Avatar for Ancient Dragon
0
103
Member Avatar for tonief

i am doing a project with visual c++ .In my project I have 2 forms . I want to do some calculation of some data of the form Form1, and i want the result of this calculation to write to a label of Form2. How to do this?

Member Avatar for tonief
0
86
Member Avatar for SallyJ

Can anyone lease tell me the value of k? I know it starts at 0 and loops backwards but I can't figure out where it terminates. I would really appreciate someone telling me the best way to figure this out so I can solve these problems in the future [code] …

Member Avatar for jesseb07
0
147
Member Avatar for shaggy7576

I do not understand what I am doing wrong... I need the second triangle to print the character the user inputs, but instead - and I have no clue as to why it is doing this - it prints the second triangle with smiley faces and other symbols. Any help …

Member Avatar for tux4life
0
134
Member Avatar for singhraghav

#include <cstdlib> #include <iostream> #include <fstream> #include <iomanip> using namespace std; struct Item { string name; int quantity; double unitPrice; string description; }; struct ItemTotal { string name; int quantity; double unitPrice; string description; }; void sort(Item list[], int n) { for(int i=0;i<n;i++) { for(int j=0;j<n-i-1;j++) if (list[j].description<list[j+1].description) swap(list[j],list[j+1]); } …

Member Avatar for mirfan00
-1
118
Member Avatar for Gewalop

Today I had this question in my exam: [CODE]write a program in C++ that covers the next points: -a company needs to enter its employees' data into the computer -each emplyee has (ID-Job Code-Division Code-Salary) -should be done using struct -Input/Output functions should be inside the struct -use the struct …

Member Avatar for mirfan00
0
144
Member Avatar for realmasa77

Hi, I have a problem with the tolower function. I use Netbeans 6.5 with GCC C++ on Ubuntu 64bit. The problem is, that I use nordic letters like Ã¥, ä and ö and the tolower function does not affect them at all. I have tried almost everything. I have tried …

Member Avatar for realmasa77
0
204
Member Avatar for anthony95

Hi guys, new to the forum so i hope that my first topic wont be full of errors. Anyway, i just started programing a couple of weeks ago in a program at my elementary school, and i have a couple of Q's. so this is my prog. [CODE] if(ima == …

Member Avatar for Gewalop
0
97
Member Avatar for manishgurnaney1

Hi all, I am using Visual Studio 2005, and developing some application. Currently i am facing one problem. I have written a class and declared some member variables in the class. In the constructor i am initializing the member variables to 0(member variable is int). But when i debugged the …

Member Avatar for ArkM
0
116
Member Avatar for inegames

[i](Im using VS C++ EE 2008)[/i] Hi people, i have had a strange problem today. Im currently programming something to do with Physics. I have searched the Internet already for the answer, including this site. The problem is: [i]error C2064: term does not evaluate to a function taking 1 arguments[/i] …

Member Avatar for tux4life
0
80
Member Avatar for fadia

hi guys.. i'm doing this program.. haven't finished it yet.. i'm not getting any errors but the program is not running correctly.. I dunnu y,, i did everything i had to and it says 1 succeeded with no warnings ! here is my code.. [CODE]#include <iostream> #include <fstream> #include <cstdlib> …

Member Avatar for fadia
0
153
Member Avatar for vahiddani

I have a text file with something like this in it: >ENSG00321 Gene_ch19 . . . . AATAGCGGTTAACATATTAATTAAACTAATGTATAGATATTATCCGCTTCCAGATTTATTATTTTGTAAA ATAGGCACAGTTCTTATCTGGTGTCACTTTATGCTTTTTTAATAGACGCCCAGCTCTACTCATGGCCAAG . . >ENSG00531 Gene_ch5 . . . . AAAGAAGCGTAGGCCCGCCATGCAGCGTAAAAAGGATAATGCGGAGCAGCGGTCCCCAAAGACTGATTTA TCAAAACTGTTTTCGCAGCAATTAACACACCCACCGACCAGTAACACCGCTGCAAGCAAGGCCACGGGCA . . I have some headers like (ENSG00321) too. I want to search in text files with header and then get …

Member Avatar for vahiddani
0
115
Member Avatar for touqra

Hi, I want to create a sequence of vector<double> each with a name + a number that goes from say 0 to 9. For example, how do I make a loop that creates10 vector<double> that goes by the name : vector_0, vector_1, ..., vector_9 ? Thanks.

Member Avatar for siddhant3s
0
113
Member Avatar for toolmanx

This is the hex output from a LARGE_INTEGER. "EA 00 0B 00 A1 00 00 00" On my machine a DWORD is read "00 0B 00 EA" How do you place the high 32 bits in the sequence? This leads me to the question of how to output this to …

Member Avatar for toolmanx
0
144
Member Avatar for madhavb

i have a following code: [code=cplusplus] #include <vector> using namespace std; class A { int t; int f; public: A(){}; }; class B { vector <A> a(10); int y; public: B(){}; }; int main(int a, char *b[]) { B c; } [/code] when I try to compile Iam getting the …

Member Avatar for ArkM
0
73
Member Avatar for brightsolar

my code so far...... [code=cplusplus] // ProjectDevelopment.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> // This libary allows standard input and output operations. #include <string> // strings are used as tempory storage - for the input to a text based file #include <vector> …

Member Avatar for brightsolar
0
235
Member Avatar for khenz

hi guys, hopefully somebody can tell me what i'm doing wrong here: i'm trying to put together a copy constructor with this linked list class, but i just cannot get it to compile: [code] #ifndef LINKEDLIST_H #define LINKEDLIST_H //*************Include Statements************* using namespace std; // for cout //***********END Include Statements*********** class …

Member Avatar for ArkM
0
4K
Member Avatar for rosemarieD

Hi there, I have not looked at C++ code for 7 years and so need a bit of help with this. I basically need to have a dll installed on a client machine. This dll will be called from another program. The dll will need to open a customed browser …

Member Avatar for MrSpigot
0
89
Member Avatar for theashman88

Hi I am new to C++ and I'm trying to create a console program that quizzes you using some of my old quizzes. My only problem is when I get to questions where there are spaces between the word it messes up. Here's an example: string answer1 = "anything\0that\0has\0mass\0and\0occupies\0space"; string …

Member Avatar for theashman88
0
81
Member Avatar for ikj

i want to print the double base representation of a number ie if my number is 38 i shud get 36 + 2 and for 655 i shud get 648 + 6 + 1. here's my code: [CODE] unsigned long bs(unsigned long a[],unsigned long d, unsigned long beg, unsigned long …

1
56
Member Avatar for atman

Hello., I'm very new in C++, and I have a task to solve. I have a function: [CODE] void cio_display(const char *str, int row, int col, int len){ int i; cio_move(row, col); if(len<=0) { cio_putstr(str); } else{ for(i=0;i<len && str[i];i++) cio_putch(str[i]); for(;i<len;i++) cio_putch(' '); } [/CODE] here iss what i …

Member Avatar for ArkM
0
296

The End.