I need to read PE file. I need to search word in PE file. Search is required to cover only the sections with the “executable” flag. And I need to specify the section where the word found. How can I do this in C? I hope you can help me. And I cannot use 3rd party libraries. This is my task and...
this user will only use this function when something extraordinary situation, and that's how I stated it in the use case diagram. Is it a bad method of stating this way?
Is it possible to bring it into this shape using the gridlayout?
I use empty label to add this empty grid
This is my code:
import javax.swing.*;
import java.awt.*;
public class test {
public static void main(String[] args) {
JFrame frame = new JFrame()...
I want to create class1. This class will have a private inner class named class2. I want to assign value to member in class2 at first. And I want to create vector<vector<class2>>vec.
I am now learning C ++ and trying to learn class and vector. I'm trying to write code, but I got an error.
this is my class and enum class:
enum class state: char{ empty='.', filled_with_x='x', filled_with_o='o'};
class class1{
private:
class class2{
class2()...
Before this part, I was getting numbers elsewhere using cin. And I add cin.ignore after that and I deleted cin.ignore before getline and it fixed. I'm just seeing your answer, but thank you anyway.
I want to generate random numbers in C++. I do not want to use C library function (`<cstdlib> <ctime> (time.h)` ) and class. So I cannot use `rand()` function in C. I want to generate random integer numbers and I guess I can use `<random>` library in C++11. How can I use this generate random...
First, I get the string and I find the frequency of the every character. My struct is:
typedef struct huffman_tree{
char c;
int freq; //unsigned?
struct huffman_tree *left; // 0 (left)
struct huffman_tree *right; // 1 (right)
}huffman_tree;
I write this to create Huffman tree...
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<time.h>
int main(){
int index=1;
int *arr;
int data;
char *c;
FILE *fp;
int input,inp;
arr=(int*)malloc(sizeof(int));
fp=fopen("list2.txt","r")...
#include<stdio.h>
int main(){
char str[]="My first book";
char *a,*b,*c;
sscanf(str,"%s %s %s",a,b,c);
printf("a=%s b=%s c=%s",a,b,c);
}
If I write like this, I am getting seg fault
#include<stdio.h>
int main(){
char str[]="My first book";
char *a,*b,*c;
sscanf("%s %s %s",a,b,c);
printf("a=%s b=%s c=%s",a,b,c);
}
I want the output: a= My b=first and c=book. But it does not work, why?
I want to write code walk around the array recursively. For some reason I cannot share my code. Let's say I have a array like this: arr[4], I want to look 012 123 013 or 01 12 23 02 03 13. In code I write I can look 012 123 or 01 12 23 but I cannot look 013 or 02 03 13. What algorithm should I...
I wirte code but it does not work. I entered n=5 and r=2, result is 0. And I want to calculate this recursively.
#include<stdio.h>
int func(int n, int r);
int main(){
int n,r;
int result=0;
printf("Enter the number:\n");
scanf("%d",&n);
printf("Enter the 2.number:\n")...
at first I added another value that holds the number in the function like this;
#include<stdio.h>
#include<math.h>
double foo(int n, double mean, int n2){
if(n==1){
return(1);
}
if(n!=0){
return( (sqrt((n-mean)*(n-mean))+foo(n-1,mean,n2))/(sqrt(n2-1)) );
}...
return( sqrt((n))+foo(n-1) );
I write like this and it works. Now I'm wondering where I would write the (n) if I wanted to calculate it sqrt((5+4+3+2+1)/n) recursively.
double foo(int arr[], double *ave, int index){
double *s;
*s=*ave;
// calculation//
return(foo (arr,ave,index));
// other calculation//
}
I want to keep the ave value during the recursion, because after ave is calculated, I will do another calculation is recursively in this...
Hello!
My homework is making a crossword.
I write a code like this:
do{
//code
printf("Please enter the coordinate and the word: \n");
scanf(" %c%d %s",&row2,&column2,word2);
if(row2=='E' && word2=="xit") exit(0);
//code
}while(count2!=10);
But this is...