OK, I changed the name of the function to "sort". Now it gives me an error: a template declaration cannot appear at block scope. What I am missing now?
Type: Posts; User: Nurlana
OK, I changed the name of the function to "sort". Now it gives me an error: a template declaration cannot appear at block scope. What I am missing now?
That's the full error message I received from teacher:
sortIS.h: Does not compile:
/tmp/ccuyaKo0.o: In function `main':
driverIS.cpp:(.text+0x2c): undefined reference to `void ...
Hi, guys Could you please help with one more question? I need to write a standalone sort function, which will take a linked list parameter and sorts it. The function is included in the main list...
Thank you, I did sort this out. All I needed was the following:
template<class T>
void BST<T>::setTraverse (TravType node)
{
if(node!=NULL)
{
trav = node;
}
}
Hi, guys, need a little bit help with Binary Search Tree. I have to write a function for traversal through the binary tree in preorder, postorder or inorder. What I understood, this function should...
Well, at least you lived to your username. Did it make your day adding nasty note at the end? I didn't thought of this task, it is my homework I am trying to do. And it specifically asks to continue...
OK, I changed the code as follows:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
Hi, guys. Need a bit of help. I have a program with try/catch block. It works fine till I press 'q' to quit program,...
The requirement is you ask the user what type of the circuit he wants and depending on choice (cin >> type (where type is either "series" or "parallel")) the program reads and calculates the required...
Need a help please. I need a program which reads from input file and then calculates total resistance and current. Circuit can be series or parallel. this is my input file:
C1
series
3
12
5 8 12...
Thank you very much, Matticus. I will try fseek().
Actually, I was in the class and I know what I was taught. I know how to write a code using structs and classes. The instructions were not to use structs or classes here. If you don't understand my...
Hi guys, need a help. I have this program:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
using namespace std;
Thank you, guys. It did help a lot! :)
Need a help please. I have a program calculating average of students grades:
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
Sorry, guys, I am really stuck. My brains will soon fry. the instructor said I need to use the following in the main:
cout << setw[6] << "Value" << setw(12) << "Frequency" << endl;
int v =...
I have already sorted the list. The function call is already in the main.
As for function description, I didn't show it here, because it was working fine.
void sort(int list[], int size)
{...
It would be good for this given array, but I need a generic function, in case if I don't know if there will be repetitions or how many repetitions in the array.
Thank you for your advise, but I cannot use Classes here. Requirement is to use basic arrays and functions.
I need a help please.
I have to count the frequency of values in the array. I have this code:
[/code]
int main()
{
int size;
int val, count;
int list[] =...