51,593 Topics

Member Avatar for
Member Avatar for sing1006

[CODE]#include<iostream.h> int tripeCallByValue(int count1) void main(){ int count=2; cout<<"count is "<<count<<endl; cout<<"count1 is "<<count1; } int tripeCallByValue(int count1){ count1=count*3; return count1; }[/CODE] when i compile with compiler,i got a syntax error.but i didnt where i have did worng.

Member Avatar for Fbody
0
187
Member Avatar for pritpal.singh88

hi friends im facing one problem i have used cin to input a choice like (cin>>ch) then i have used to take input to string as getline(cin, string_s) but getline does not works when i use cin if i donot use cin it works well why it is happening??? and …

Member Avatar for Kanoisa
0
127
Member Avatar for Theisonews

i want to create a program that will have an arraycalled array1[] of 30 sets of 3 one digit numbers i.e 804, 450,430 etc) i will have 13 vector containersor arrays defined with a series of 3 one digit numbers. i want the program to find any series of numbers …

Member Avatar for Lerner
0
122
Member Avatar for newack

I havve database project to run. i have two tables with relationship. i want to show some filds of one table and some fields of other. When i run it, it throws exception and says "object reference not set to an instance of an object" what could be the problem?

Member Avatar for Narue
0
73
Member Avatar for jimJohnson

I am just about to finish my last C++ program and for the life of me cannot figure it out. My problem is everytime I try to run this my command prompt returns with "Write file cannot be opened". I have looked many times throughout my program and cannot figure …

Member Avatar for jimJohnson
0
147
Member Avatar for IndianaRonaldo

char* p=(char*)malloc(10); in the above state ment,has the memory been initialised??...what is the difference between allocatingg it and initialising it?? thanks in avdance...

Member Avatar for IndianaRonaldo
0
215
Member Avatar for sha11e

I have a c++ program that uses the rand function and the srand function. It worked fine when I compiled it on my windows machine, but I got errors when trying to compile it on ubuntu linux. After I included cstdlib the program worked fine on the linux too. 1. …

Member Avatar for Narue
0
299
Member Avatar for kabilah

I'm having an issue with a Hanoi Tower problem. I'm passing an index variable and a vector to the recursive function. The disc numbers are being displayed correctly, but the peg numbers are not. The output is only the moves not the disc numbers on each peg. Output should be …

Member Avatar for kabilah
0
1K
Member Avatar for mistereff

I want to be able to determine if there are less than 9 values of 'S' but it always returns a count larger than it should be. The array is board[7][7]. Edit: The cout for sheepCount is for debugging purposes. [CODE] int sheepCount; sheepCount = 0; for (int i = …

Member Avatar for sfuo
0
157
Member Avatar for pritpal.singh88

hi friends i want a delay of 100 milliseconds in my program as their is delay function in dos.h likewise i want to know [B]is there any function in c++ for delay of some milliseconds im using ubuntu.[/B]

Member Avatar for sergent
0
940
Member Avatar for butler273

So this is probably going to seem like an obviously simple question. I'm working on a basic project involving linked lists. I have a single link linked-list, within this linked list I have a pointer to an dynamically allocated Object I'd like to be printed, currently I keep getting rubbish …

Member Avatar for mitrmkar
0
201
Member Avatar for munitjsr2

[CODE] #include <iostream> #include <cstring> using namespace std; class CD { public : void getCDdetails(CD *); void printCDD(CD *) const; int putCount() const { return count; } private : static int count; char Title[60]; char Artist[60]; char Type; int Tracks; }; int CD :: count=0; void CD :: getCDdetails(CD * …

Member Avatar for munitjsr2
0
162
Member Avatar for template<>

Hello Community, I am trying to figure a simple way approximate cost of context switching for a given OS/hardware combination under different loads. For example on my 2 GHz dual core MAC OSX, running single instance clocks at 0.5 usec where as three instance at 1.3 usec. Below is sample, …

Member Avatar for template<>
0
382
Member Avatar for AODfan

I am having a problem where the colsum[column] is just displaying junk data on the output, and I cannot seem to figure out why, if I put an output statement in the Computesums function for it outputs fine(just not the right place, this is fine, I was doing that for …

Member Avatar for AODfan
0
162
Member Avatar for raigs

[CODE]myuser@linux:~/Desktop$ gcc -nostdlib -Wl,-dynamic-linker,/home/myuser/Desktop/ld-linux-x86-64.so.2,-rpath,/home/myuser/Desktop libc.so.6 libgcc_s.so.1 simple.c myuser@linux:~/Desktop$ ldd a.out linux-vdso.so.1 => (0x00007fffbf5ff000) libc.so.6 => /home/myuser/Desktop/libc.so.6 (0x00007f308b7ae000) libgcc_s.so.1 => /home/myuser/Desktop/libgcc_s.so.1 (0x00007f308b598000) /home/myuser/Desktop/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f308bb11000) myuser@linux:~/Desktop$ [/CODE] Which ld is being used, the one on the Desktop or the one in /lib64 ? What options do I have to use …

0
110
Member Avatar for newbie14

Dear All, I have a code as below. First I call the readFile in here I can read the value into the name variable which I have declared as string. The problem now as I run the loop I want to put each of the name into an array of …

Member Avatar for newbie14
0
319
Member Avatar for rkcastillo

I'm developing a program that will search through a Google Search Term and add that website to a spreadsheet. Does anyone know an algorithm to look at that website and find the contact email?

Member Avatar for TrustyTony
0
67
Member Avatar for yakovm

I want to implemet linked list in c++ ,while adding new node I dynamicly allocate it, if some allocation fails I would like my program to stop the execution. After the "new Node" fails the exception is thrown so do I have to call the destructor explicitly in the exception …

Member Avatar for Narue
0
69
Member Avatar for sergent

I have several questions regarding OS programming. 1 - How do they write Operating systems? 2 - Do you know what compilers is used to do that (or library)? 3 - Do they have to burn it to a CD and reboot the computer every time they test it? 4 …

Member Avatar for sergent
0
176
Member Avatar for chess2009

[CODE] Str Str:: operator+(const Str & append) const { unsigned i,j; for(i=0,j=0 ; i<append.used; i++ ,j++) temp[i]=append.data[j]; for(j=0 ; i<used; i++, j++) temp[i]=data[j]; temp[i]='\0'; } [/CODE] used and append.used are the length of strigs. and data is pointer to array. Hi I am trying to concatenate two strings in the …

Member Avatar for jonsca
0
117
Member Avatar for asadaziz

what i wanted to do was to read multiple .doc(files) and apply an algo on it, now .doc files can be read with stream reader the problem here is how to read multiple files in a folder and the names of the files are also not known please help

Member Avatar for asadaziz
0
377
Member Avatar for apanimesh061

[CODE] //clrscr.h #pragma once #include <windows.h> #include <iostream> #include <conio.h> using namespace std; void clrscr() { COORD coordScreen = { 0, 0 }; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hConsole, &csbi); dwConSize = csbi.dwSize.X * csbi.dwSize.Y; FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten); GetConsoleScreenBufferInfo(hConsole, &csbi); FillConsoleOutputAttribute(hConsole, csbi.wAttributes, …

Member Avatar for apanimesh061
0
160
Member Avatar for king03

Please help me out guys I can't fully understand how this code works but I know some about it and I'm also unsure of such things about how it operates. [CODE]#include<iostream.h> #include<conio.h> int main() { for(int i=1; i<=6; i++) { for(int f=1; f<=i; f++) cout<<"*"; cout<<endl; } system ("pause"); return …

Member Avatar for Fbody
0
2K
Member Avatar for Hyiero

Question on getting my class to work with a project I am working on oldY = changeY1(pos1[0]); I call the changeY1 function in my main and am setting a int = to the value returned,I am declaring this function in a seperate class of its own : [CODE] #ifndef INTERVAL_H …

Member Avatar for sergent
0
99
Member Avatar for toferdagofer

i'm making a quick class that has some getters and setters. i'm getting an error at line 46 when i try and create my setItemNumber function. Im also getting an unexpected EOF error but i think that it might have to do with my first error. this is my code.... …

Member Avatar for toferdagofer
0
158
Member Avatar for rena0514

The purpose of my program is to have the user to enter a word to be checked to see if its a palindrome or not. My program works in Visual Basic...but i have to turn it in to my teacher through SSH. When I run my program there this is …

Member Avatar for WaltP
0
372
Member Avatar for Hyiero

Making a Game for a school project and Im using a 2D array to make the gameboard. Well in the begginning of the game the user has to input what the current game board looks like. I have it so the user is entering data and the data is being …

Member Avatar for Hyiero
0
145
Member Avatar for KazenoZ

Hello, Let me introduce to you my problem first, and then you guys should decide on the best method to take upon it. My sister has lately been HELLa annoying with her crush over Justin Bieber, and it's really starting to get to me not to be able to think …

Member Avatar for sergent
0
194
Member Avatar for resell4

Is it better to write the void funtion before the main funtion, or write it below the main function and mention it "prototype" it before the main? I know both works, but im wondering if the program uses a bit more time searching for it when its below the main …

Member Avatar for sergent
0
91
Member Avatar for Ulia

Hello!I need my program to display data from Edit control. But the main window does`n update when I press OK button on Dialog boxes. Please, help me to find out what`s wrong with it...(please sorry for my English). Thanks in advance for any help. [CODE]#include <windows.h> #include "resource.h" #include <tchar.h> …

0
60
Member Avatar for sergent

I am making a game bot which does certain function for a certain ammount of time. I want to give the user an option to shutdown when it all ends. What functions are out there to do that? Can I do it with <windows.h>?

Member Avatar for sergent
0
80
Member Avatar for sara90

hello every one, i have a problem in parsing a text file this is a sample text file: 6 1 1 + 3 4 5 + * 3 4 5 * + 1 + 1 1 1 + 2 3 8 2 / - 1 + * the first line …

Member Avatar for VernonDozier
0
98
Member Avatar for marrkee

Hello, I'm new to c++ and i'm making program to read from numbers from file and calculate average. The numbers in file is like this [CODE]10; 15; 200[/CODE] and my source so far [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream …

Member Avatar for marrkee
0
123
Member Avatar for eman 22

Hi,All I'm now working in project to compress a files. And I used Huffman encoding to get new code for each character in the site. but now I can't complete my project. How can I use bitwise operation to put all those new codes into the compression file. and Also …

Member Avatar for eman 22
0
562
Member Avatar for davelee

Hi, I am writing a student database in C++. There comes a point in my program where I have a succession of "cout's" requesting the user to input the students grade for a particular course. I want to check that the input is not less than 0 or greater than …

Member Avatar for davelee
0
1K
Member Avatar for Buffalo101

Hello, I want to code an application that calculates a program's complexity. I may have put this the wrong way: I want to count the operators, variables, function calls etc. in a C/C++ program. At first I thought about reading the .C file as a .txt file, looping through each …

Member Avatar for Buffalo101
0
108
Member Avatar for Osas106

good day every one i am osagie by name, i've been trying to develope a biometric(fingerprint) software in win32 that will serialise and save all user fingerprint record to a binary mode cpp file(after due analysis). Thereafter, d program is expected to send a copy of the serialied file to …

Member Avatar for jonsca
0
131
Member Avatar for MicroBanned

Hi there, I am wondering what I am doing wrong ss when a user inputs anything on the 10th row..the 'X' char is misplaced :s Also, I cannot seem to limit the user from inputting BEYOND the board..I feel like I've taken a wrong step somewhere. Thanks once again :) …

Member Avatar for MicroBanned
0
87
Member Avatar for broli100

Hello, I am doing simple program with Visual Studio and I am using System.Windows.Forms. It has DataGridView, which represents sudoku board. Everything goes OK, but when I manually edit some cell, then the program crashes and throws some exception, which has something to do with unproper conversion of types. Here …

0
62
Member Avatar for cookiemonstah

I need help on making an isosceles triangle 2sides with 5 asterisks, and a base with 9 asterisks, and has no asterisks inside the triangle. I've come up with the codes on a 2sides with 5 asterisks and the base with 9 asterisks, but this time, it has asterisks inside …

Member Avatar for sfuo
0
196
Member Avatar for Skabix

I am converting seconds to minutes, hours, days. For some reason I have an issue with the days not calculating when running the program. The 'if' statement seems completely ignored by the program. I think this may be caused by the warning I get. Any help would be greatly appreciated …

Member Avatar for Skabix
0
1K
Member Avatar for murnesty

I searched from internet. They said have 2 ways to create sub-function file, first way is : using header file which is easier to write. second way is: using cpp file which will increase the compilation time. But my lecturer say using header file to write sub-function is a wrong …

Member Avatar for Ancient Dragon
0
152
Member Avatar for boliviano3

I'm having a couple of problems w/ getting the program to end when the user enters 'Q' after they've been asked if they want to try again. Also, after enter a negative int is entered for employee id then either the program moves to displayEmployeeInfo & shows the info that's …

Member Avatar for boliviano3
0
176
Member Avatar for cafegeo

I am writing a program that accepts an input file of 10 items each having revenue across 4 quarters. In this particular function I have to determine if the items profit has steadily increased, decreased or went up and down across the 4 columns, or quarters(qu) as they are referenced …

Member Avatar for VernonDozier
0
2K
Member Avatar for g-pita

Hi I'm trying to create a program that gathers data from some ADC connected and do some averaging on the data. It's build up around classes containing systeminterface and sensors making a datamodel. The program is pretty big, but has worked intil implemention of pthreads I wanted to create a …

0
116
Member Avatar for cableguy31

I'm having a problem writing an unsigned char array to a file. When I write it to stdout using printf, it displays properly, however if I write it to a file, when I open it, I can't read the file. It looks like it may be writing the file in …

Member Avatar for Narue
0
741
Member Avatar for bops

How would one read an encrypted file's (encrypted using windows' EFS) header? I would like to be able to read the header and extract FEK that was encrypted by either the public or private key of the file. From reading up I understand the structure of the file header I'm …

Member Avatar for grehe
0
481
Member Avatar for pengkeanh

Hi All, I am working on optimizing the memory usage of my codes and I found a problem that I do not understand. Please let me know what you think. Code: [CODE]typedef map <pair<string, int>, vector<pair<int, float> > > TDM; void parsefile (TDM & my_map, string in_file); // parse input …

Member Avatar for Aranarth
0
290
Member Avatar for ichigo_cool

I'm working on a map editor and the tiles show up i a file as [CODE]1, 0, 0, 1, 1, 0, 1, 1[/CODE] so here's a 4x2 map. I'm wondering how can I parse out the integers from the commas and assign them to a multidimensional array so that \i …

Member Avatar for ichigo_cool
0
4K
Member Avatar for shyla

my question is: Write a function that accepts an integer parameter and returns its integer square root. The function should throw an exception if it is passed an integer that is not a perfect square. Demonstrate the function with a suitable driver program. i am getting that : Error 1 …

Member Avatar for shyla
0
2K

The End.