49,755 Topics
![]() | |
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 … | |
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 … | |
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? | |
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 … | |
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... | |
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. … | |
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 … | |
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 = … | |
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] | |
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 … | |
[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 * … | |
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, … | |
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 … | |
[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 … | |
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 … | |
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? | |
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 … | |
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 … | |
[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 … | |
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 | |
[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, … | |
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 … | |
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 … | |
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.... … | |
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 … | |
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 … | |
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 … | |
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 … | |
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> … | |
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>? |
The End.