#include<iostream> #include<vector> using namespace std; int main(int argc,char** argv){ int n; if(argc>1) n=argv[0]; int* stuff=new int[n];
I do a pokemon project with a Qt interface. I created a class Trainer and Pokemon : class Pokemon { protected: string itsName; doub
As you can see it is giving me 1 but why? When i do t-p then it gives me -1 . Why ? int f=4, o=8; int *p, *t; p = &f; t = &o; printf("Difference betwee
Is there a concept like a pointer to a string in javascript? Or how would this be done? let s1 = "hi"; let s2 = "bye"; // I want to write my code like this [,]
I'm trying to create a program which the user inputs the number of items (rows) and give each one of them a name (scanf) with the max of 30 characters. I want t
I'm trying to get a better understanding of the C standard. In particular I am interested in how pointer arithmetic might work in an implementation for an unusu
Here is the scenario: I have an array, AllElements of structure ElementSet, and inside of that structure - is a set of myElement structures and also an array of
Im using c++ 11, I need to save/load array to and from file. Its the battleship game its need to be done for both user and computer array but i have no idea how
I am trying to read input.txt file, and trying to put each line into the array as string (later on I will use each element of array in initializing obj that's w
I read about std::is_pointer in C++. Then I wrote the program and check whether T is a pointer type or not using std::is_pointer. #include <iostream> i
I have a source pointer (pSource) and a goal pointer (pGoal). I also have a number of characters (n) that need to be copied to the pGoal from pSource. I thought
#include <iostream> #include <new> const int BUF = 512; const int N = 5; char buffer[BUF]; int main(){ using n
I am trying to use dlopen() and dlsym() in my code and compile it with gcc. Here is the first file. /* main.c */ #include <dlfcn.h> int main() { v
As far as I understand int* p = new int(); Is something like creating an int with a constructor. If so why does the following code work like an array? int* p =
I'm trying to experiment here with pointer arithmetic, but I get this warning. I am unable to understand where is this going wrong. The code is written to p
I'm trying to convert a char * to uppercase in c, but the function toupper() doesn't work here. I'm trying to get the name of the the value of temp, the name be
We have written one program by which we try to find an address of a constant. Is it possible to do it like that? package main func main() { const k =
i'm trying to learn about function that returning a pointer to a function, after i tried to compile the code, it gives me this kind of error: cannot convert
I'm trying to share mmapped area in 2 processes. In my program, I create memory_update() process and memory_read() process. This memory_update() process update
I have the following method defined: func (o *MyObj) parse(something string) string { // Do stuff } This code (1) compiles just fine: (&MyObj{}).parse(