What is the use function in c++? [closed] - c++

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I'm currently reading a c++ book and one of the function is
void fp(char v[]){
for(char* p = v; *p!=0;p++) use(*p);
}
I wrote this into my editor and compiled it. I also included the headers
#include <iostream>
#include <string.h>
But my terminal returns the following message:
use of undeclared identifier 'use'
I also google it and its nowhere to be found online, the function doesn't exist.

That's because there is no such standard library function.
The author is either using pseudo-code here, or has defined this function somewhere else in the book.

Related

namespace std has no member any_of [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I'm trying to see if string contains number. As I was searching on this site, i saw implementation by saying std::any_of(password.begin(), password.end(), ::isdigit) and it is supposed to return boolean value, true or false.
However, visual studio keeps saying thath namespace std has no memeber any_of.
std::any_of resides in the <algorithm> header which you need to include:
#include <algorithm>
Reference

why do i keep getting vector cannot name type error in C++? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I keep getting the error "vector does not name type" from one of my classes each time I try to compile my code.
#ifndef DISK
#define DISK
#include "PageTableEntry.h"
#include <vector>
class disk{
private:
Vector <PageTableEntry*> frames;
public:
void addFrame(int Location, PageTableEntry* pte);
void removeFrame(int pteLocation);
Disk();
};
#endif
You should quote errors verbatim. I assume the error is actually more along the lines of Vector does not name type.
You have either not included the declaration for Vector in your code, doing so would provide the compiler with a type, or you have (more likely) mistakenly written Vector when it should be std::vector. Letter case and namespaces matter in C++.
Try:
std::vector<PageTableEntry*> frames;

C++ error: decomposition declaration not permitted in this context [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
Why is g++ giving an error like this?
blahblah.h:80:10: error: decomposition declaration not permitted in this context
float[NUM_OUTPUTS] output_buffer;
(Already solved, but creating this because there's no good google hits for this error text, and the error message is inscrutable.)
In C++ declarations, the array size goes after the variable name, not after the type:
float output_buffer[NUM_OUTPUTS];

Cannot include <vector> [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I am using gcc under OS X and I get an error
fatal error: 'vector' file not found
when trying to include the vector implementation. Other includes like
#include <stdio.h>
#include <stdlib.h>
are working. Where is the vector file located?
vector is not part of C. You must use C++.
Try compiling with g++ rather than gcc
The vector C++ header enables the use of vector template class.
Include :
#include<vector>
and compile the program using g++.
Vector file you can add in c++ only, C doesn't support the vector property.

multiple versions of stdlib.h [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I was trying to compile a program and stdlib.h didn't seem to exsist. When I tried to search for it I seem to be able to find 4 versions of stdlib.h. I was wondering how one can correct this issue:
:6:20: fatal error: stdlid.h: No such file or directory
#include <stdlid.h>
^
compilation terminated.
sudo find / -name 'stdlib.h'
/usr/lib/syslinux/com32/include/stdlib.h
/usr/include/stdlib.h
/usr/include/x86_64-linux-gnu/bits/stdlib.h
/usr/include/c++/4.8/tr1/stdlib.h
stdlid.h is wrong, you need a b instead of a d