49,757 Topics
| |
Can't find out the error. #include <iostream> using namespace std; struct node{ int id; int *next; }; node * get_data(int ); node * get_data(void); void insert_node (node **, node **, node *); void display_data(node *); int main(){ node *head=0, *tail=0, *newPtr=0; newPtr = get_data(); insert_node (&head,&tail,newPtr); display_data (head); return 0; … | |
Hello everyone! I know QObjects doesn't support copy constructors but how can i create a copy of a QObject. I want to make changes to the object while still maintaining the original copy. Thanks | |
Hello, my Qt app gives the following run time error > HEAP[testApp.exe]: > QInvalid address specified to RtlFreeHeap( 0D920000, 0F29F1C0 )uoted Text Here But it's free from error when i comment out these lines table->setCellWidget(currentRow,4,wid); table->setCellWidget(currentRow,2,++wid); table->setCellWidget(currentRow,1,(++wid)); Please i need help seriously. for(int i=0; i<currentSem->courses->count(); i++) { QVBoxLayout *vlayer = … | |
Hey guys I just learned how to work with header files but I have a simple error . I suggest you guys dont look at gameboard.cpp because it just runs fine with ubuntu and no errors with it. my problem is when I run the main it gives the eroor … | |
I need help trying to figure out how to insert into a multi linked list. I know how it works with a linked list with only one piece of data but not 2 pieces with 2 pointers. Essentially what I want to be able to do is creat a multi … | |
We were assigned the birthday paradox as a homework assignment. The program intakes a number of people to check and returns the number of people with a shared birthday. I seem to be having trouble figuring out the loops for the function check_birthdays. I input a number and a number … | |
//This program is supposed to read 20 scores from an input file and initialize them to an array //then print the components into 2 separate output files #include <fstream> #include <string> using namespace std; const int ARRAY_SIZE = 20; void printArray1(int scoresArray[], int sizeX); void printArray2(int scoresArray[], int sizeY); ofstream … | |
I just have a program to implement RSA encryption, and it runs but when I try to encrypt a message it crashes. When I bebug it won't show any error, What is the issue,How Can I fix the program? #include<iostream> #include<cmath> using namespace std; #define MAXLENGTH 500 int size = … | |
#include <iostream> #include <cmath> using namespace std; int main () { double n = 1; double sum = 0 ; double previous = 0; double y; while(fabs(double (sum - previous)) > 0.001) { y = -1 (exp(double (n))) / n; **<<<Error is here<<<<** sum += y; previous = sum - … | |
what is static function in c++? when should a function is made static? | |
So I have always developed in a 32 bit environment, but now have the opportunity to step into 64 bit development. What I am working on requires a lot of pointer aritmatic, and I am a little confused how primitive data type sizes vary from 32 to a 64bit platform. … | |
I am trying to write a program that will test for the birthday paradox. I need to run a series of experiments on randomly generated birthdays, which test this paradox for n = 5, 10, 15, 20,...,100 (n = number of people in any given room). I need to run … | |
Hi there, I was wondering if anyone could help me, I’m trying to send various packets of data over network via UDP. I’m using the sendto() function in winsock2. I’m trying to send different data types over UDP, for example; I have positional data such as: int time; float LAT; … | |
can anyone solve this problem for me ??? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include<iostream> #include<string> #define size 10 using namespace std; struct student { string name; int id; string prog; double cgpa; }; class stinfo { private: student data[size]; int last; public: stinfo(); void add(string name, int id, string prog, double cgpa); }; stinfo … | |
I want to assign a value to the variable x which belongs to the class X using friend function. Is there any way to assign a value, say 30 to the variable x using the friend function. I tried the following code but the output is different. [CODE]#include <iostream> #include … | |
hi, i am very happy that i found this forum :) i am a beginner so, i have some question. if somebody could answer me i will appreciate it. can i write a program for numerical analysis in Turbo C? i have to write program but i don't know where … | |
which one should be preferable from the following two nested for loops: 1. for(i=0;i<100;++i) { for(k=0;k<10000;++k) { <lines of code> } } 2. for(k=0;k<10000;++k) { for(i=0;i<100;++i) { <lines of code> } } why? | |
when you write code in the main function if you put functions in the file all you do is nameoffunction(); to call it. now my question is this lets say you have a menu in a class. call it bank. in the main to call that function . ive tried … | |
A Very Good Morning to you, Hi and how do you do ? I hope your day is going great. I would like help writing a CPP Function() with the following criteria :- It is to search for 4 digit numbers in a Pick 4 Game. 1. Given a 2D … | |
This is a program to generate possible combinations Somehow everytime I run it - in VS2012 I get this error - "Expression:Vector Subscript out of range" ? Can someone please help to get this code working ? A Big Thank You !!! :D #include <iostream> #include <vector> class CombinationsGenerator { … | |
http://i.imgur.com/kWrBizl.png In the above Image, I generator a Sudoku Matrix of 9x9 values. Is there any way I can allow user to enter individual values by moving around the caret and typing? Basically, I want them to just be able to change the values displayed on the screen by moving … | |
I'm writing a program that will keep track of every Anime/Manga I watch/read(I'm an avid fan). I'm trying to make a database in order to keep track of all of the titles of the Anime/Manga. My problem is that when i try to add a new title to the existing … | |
Hi! I want to make a CONVERTER. I designed it, so I just have to program some buttons. The problem that I have is weird. I programmed a button that says : CONVERT TO METER. After I build the program, I get ERROR C1075 : end of file found before … | |
Hello Everyone i am trying to write a program for printing all the combinations of a string.I do not want any help regarding the algorithm but i need help figuring out why this program is giving the error message "First-chance exception at 0x761bc41f in word.exe: Microsoft C++ exception: std::out_of_range at … | |
I am having a runtime error happen when I run my program and can't seem to figure out why. It is happenning on my insertion sort function. I also am going to have to do a selection sort with this and aany help would be greatly appreciated. Here is my … | |
Please enter your starting balance: 200 What would you like to do? B...Show Balance D...Deposit W...Withdrawal Q...Quit B Your balance is 200.000000 Press any key to continue . . . i put my set precision to 2 and it's printing 6 zeros. how come? | |
Guys I am trying To send a mail using C++ code i found from the net , when i compiled it it says In function `_Z13ChilkatSamplev': [Linker error] C:/Users/dhayalan/Documents/mail.cpp:10: undefined reference to `CkMailMan::CkMailMan()' [Linker error] C:/Users/dhayalan/Documents/mail.cpp:14: undefined reference to `CkMailMan::UnlockComponent(char const*)' [Linker error] C:/Users/dhayalan/Documents/mail.cpp:21: undefined reference to `CkMailMan::put_SmtpHost(char const*)' [Linker … | |
can anyone show me how to convert this linkList statement into Array ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class linklist { private: struct node{ struct student{ // node->info string name; int id; string prog; double cgpa; }st; node *link; }*head; public: void insFirstNode (string name, int id, string prog, double cgpa); }; void linklist::insFirstNode(string … | |
#include <iostream> using namespace std; struct td{ int ** subj_no; }; int main(){ td p; **p.subj_no = new int * [7]; } If not then how should I accomplish this task? What's the corrected version? | |
The End.