49,757 Topics

Member Avatar for
Member Avatar for triumphost

template<typename T> void Transpose(T** Data, std::size_t Size) { for (int I = 0; I < Size; ++I) { for (int J = 0; J < I; ++J) { std::swap(Data[I][J], Data[J][I]); } } } int main() { int A[4][4] = { {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, …

Member Avatar for mike_2000_17
0
113
Member Avatar for kamalashraf

#include<iostream> #include<fstream> using namespace std; int main() { int n=0; int sum=0; ifstream fin; fin.open("input.txt"); for (int i=0; i<4; i++) { fin >> n; sum=sum+n; } cout << "Sum of given numbers is " << sum << endl; return 0; } in the above code, i want to fetch data …

Member Avatar for triumphost
0
599
Member Avatar for Chay Hawk

Ok so in my code im trying to beable to let the user enter the name of a list in main then pass the string to word_list function but my program just keeps saying file failed to open. If you spot any other problems please help me with them ive …

Member Avatar for tinstaafl
0
146
Member Avatar for e.patricioparga

I wanna build a program that allows you to send a mail and advices you when you have new mail. I know that for this I have to kee it running in the background. Would you recommend using C++ for such a purpose? (It's pretty much a mail client for …

Member Avatar for iamthwee
0
161
Member Avatar for isha.dakhara

i have got a c++ project to work on and the topic is shopping....i have to get something and neww added to it and the whole code is needed....

Member Avatar for rubberman
0
161
Member Avatar for justin.chestnutt

http://www.cs.ecu.edu/~rws/c3300/prog1.pdf (for anyone that wants to view exactly whats needed for turn in) Hello! I'm trying to write a c++ program that takes in the lower and upper limits of a bunch of numbers and output the length of the longest hailstone sequence. Posted below is what I have so …

Member Avatar for Fatma30
0
1K
Member Avatar for t2nator

I am making this program for a class and it works fine except for the daily interest rate for the checking account is off. The daily interest for the savings computes perfectly. The monthly interest rate for savings is 6% and for checking 3%. Account.h #ifndef ACCOUNT_H #define ACCOUNT_H #include …

Member Avatar for dexblack_1
0
167
Member Avatar for taogomano.wau

if there is a warning ***case bypasses initialization of a local variable*** in a C + + program, what is the solution to solve it? please help

Member Avatar for RonalBertogi
0
292
Member Avatar for mr.unknown

please explain this code to me ` main() { int u,i; for (u=1;u<=5;u++) { for (i=1;i<=u;i++) cout<<i<<"\t"; cout<<endl; } } OUTPUT: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 explain that how two loops are controlling this output someone explain it step by …

Member Avatar for sanjulovers
0
181
Member Avatar for daniel1977

Im having a problem with the following exercise. I have the whole program working, however, the transaction time is not passing to the customer. The only element that this affects is the time that the customer leaves. Anny assistance would be greatly appreciated. Best, Dani Below are the 5 files …

Member Avatar for dexblack_1
0
609
Member Avatar for iraklakis

Don't know why my code crashes when j=317. I thought was the matrix dimensions, so tried some numbers. Nothing particular happened. Every help would be very usefull. #include <stdio.h> #include <math.h> int main(){ int T,i,j,t,c,r[T],Jmax,Z,k; float v[10],R[10],EBNo[10],trapserv[10],a[10],w[10],Pblock[10]; float L[j+1][j],B[T+1][j+1],b[T+1][1000],P[T+1][j+1],q[j+1],qnorm[j+1]; float sigma,mtimi,mtimic,CV; float Nmax,g,W,EIother,C,Nown,No,totofcell,sumq; float Gamma,bita,QA,LA,BA; float x; //Data input// ` …

Member Avatar for iraklakis
0
228
Member Avatar for erogol

I have two structures as; struct collapsed { char **seq; int num; }; // set of collapsed examples struct data { collapsed *x; int num; int numblocks; int *blocksizes; float *regmult; float *learnmult; }; And I have one statically defined 'data X;' need to be transmitted into device memory from …

Member Avatar for Moschops
0
3K
Member Avatar for Ram J

I need a C++ program which receives two numbers from input (n, x) and calculates the following equation for entered numbers (n, x). 1 + x/1! + x2/2! + · · · + xn/n!

Member Avatar for sanjulovers
0
201
Member Avatar for pearl doll
Member Avatar for daino

I'm trying to use std::ofstream to create a file but I'm getting an error. I'm using a string variable instead of a string. example below. std::ofstream Myfile("C:\\testfile.html"); // This works fine //but the below doesn't string mystring = "C:\\testfile.html"; std::ofstream Myfile(mystring); //doesn't work. Not sure why. Any clues?

Member Avatar for Moschops
0
484
Member Avatar for sanyam.mishra

In my program I need to execute two loops at same time. How can I do that? As windows have multi processing can I too complete two or more processes at same time? Actually I need 3 different timers which will be running simultaneously.

Member Avatar for mike_2000_17
0
571
Member Avatar for 9tontruck

Hi.. d1 = a1*x1 + b1*x2 + c1*x3 d2 = a2*x1 + b2*x2 + c2*x3 d3 = a3*x1 + b3*x2 + c3*x3 Knowing all of a,b,c,d, I have to find x1, x2, x3. As you might noticed, this is high school math. But, how do I write the code to …

Member Avatar for DavidB
0
409
Member Avatar for DarrelMan

Making a command line interpreter for my Operating systems class The following line is giving me a problem if (strcmp(argv[0], "ren") == 0) { return RENAME; } For whatever reason it does not return anything. However if I change "ren" to "darrel" it returns the proper value of RENAME and …

Member Avatar for DarrelMan
0
192
Member Avatar for lemongardens

hi ı have an exam can you give some examples about win32 especially main part of programme thnks

Member Avatar for Ancient Dragon
0
133
Member Avatar for GregXaiver

Good Morning, My name is Greg and I am trying to teach myself to write code. But I have a question I wrote a program that compares a range of numbers and tells you the grade. The program works and dose what it is supposed to do but I have …

Member Avatar for GregXaiver
0
162
Member Avatar for nitin1

although, i have read C++ books in my past, but as my placement session is there, i just want to have some books from where i can see everything in shortest and concise possible. classes, polymorphism, inheritnce concepts etc like this . any book which u can tell me ? …

Member Avatar for dexblack_1
0
167
Member Avatar for daino

This is going to look like a very basic question to allot of you but for the life of me I can't find how to do this anywhere on the web. Allot of convoluted solutionsn out there. I simply want to save a textfile as a .html file. Having seriouse …

Member Avatar for daino
0
1K
Member Avatar for shadyreal

Hi Im a student and just started 3D programming 2 weeks ago. I have this problem: I got a working collision detection against models created in Maya. But: The collision is only inside the model, with the normals on the model pointing out as it should be. If I revers …

Member Avatar for shadyreal
0
267
Member Avatar for tazeen_muzammil

Write a function that, when you call it, displays a message how many times it has been called: "I have been called 3 times". write a main program that calls this function at least 10 times.

Member Avatar for Schol-R-LEA
0
327
Member Avatar for yashdeshmukh

How can we implement polymorphism in a C++ program that connected to a MS Database(the program is storing the details of employees of a school)

Member Avatar for rubberman
0
136
Member Avatar for mahesh113

How come the output of this program is 1413, I expected it to be 1414. (i + 1)->value() should have called R::value(). is n't it? #include<iostream> #include<vector> using namespace std; class Q { public: Q(int n = 0) : m_n(n) { } virtual int value() const { return m_n; } …

Member Avatar for Lucaci Andrew
0
166
Member Avatar for otengkwaku

Hi guys, i am working on a project the need me to convert a compressed obj file using webgl utf-8 compresor [webgl-loader](https://code.google.com/p/webgl-loader/) back to it acsii version. I will like someone to point me in the rigth direction. i am comfused as to how to do the decompression

Member Avatar for LastMitch
0
266
Member Avatar for new_developer

Hi there, Is there a way to check a variable if it is not initialzed by value ? I need a check for all datatypes. int num; if(!(numIsNotInitialized)) num = 12; else cout<<"num : " <<num <<endl;

Member Avatar for mike_2000_17
0
315
Member Avatar for new_developer

Hi there, I am implementing the concept of polymorphism and write following program of shapes. #include <iostream> using namespace std; class Shape { protected: double width, height; public: void set(double w, double h) { width = w; height = h; } virtual double get() { return 0; } }; class …

Member Avatar for new_developer
0
181
Member Avatar for oosinoots
Member Avatar for adam tolstoy
0
147

The End.