- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
44 Posted Topics
![]() | Re: You can always use hashtable with (key,value) pair for each word and count its occurence. |
Re: > int ascii[size - 1]; It should be of size 'size' not 'size-1' and its index will run from 0 to size-1. > hash[i] = ascii[i]; While you are using string class you would be better off using string library function to append the character to the string thus assuring … | |
![]() | Re: Your variable words is of data type char\*\* while longest and shortest are of data type char\*. So, in words you ned to specify the index of word(char\*) in order to compare with shortest or longest. In line 56, you are trying to access words[100][16] which is out of bounds. … |
Re: It may be the case that you are desired to report some implementation along the lines of STL vector class. Just saying... | |
HI, I am trying to set the consecutive pixels to a specific color so as to obtain a line. Though, I know there is a built in function for drawing the line, but I am interested to do it without using any GL primitive. This is the display function as … | |
Re: > it means there will be only one destructor in class to destroy all the objects....... I would like to point out that a destructor if called by an object destroys that particular instance of object. Each object should call the destructor separately to remove their corresponding instances. | |
This is the code which put an extra line to the std::string array. I am here trying to print last k lines of file. Any help is appreciated. #include <iostream> #include <fstream> #include <string> using namespace std; //file.exceptions(ifstream::eofbit | ifstream::failbit | ifstream::badbit); void print_last(unsigned k, string file_name) { string *data=new … | |
I stumbled upon the fact that one can't bind a temporary variable to a reference unless it is a constant and found it to be indeed true in the given code. However, i am not able to find out the difference in my other code snippet where I didn't use … | |
This code only print characters until char value is 0 but surprisingly it output characters only upto first blank space. I checked their ASCII values and surprisingly ASCII value of space(' ') character was output by program as 0. I couldn't get it. Any help is appreciated. #include <iostream> #include … | |
I intend to perform in-place modification of std::string with the help of a modifier function. In this regard, I looked up on internet and found that pass by pointer method is not recommended. I have few queries in this regard. * If I pass a std::string to the function as … | |
Following is the code snippet to override exception::what() function, but what I couldn't figure out how removing const-ness of the function produces following null terminated character string "std::exception". What I could think of is that since exception::what() is const its overriding should also be const. But, even if it is … | |
This is a program to reverse the string in place. I have used pass by pointer. Interestingly I have changed the pointer in reverse function which is notable by seeing its output but the pointer which was passed in main function still points to the start of string. This is … | |
Re: It is used just like normal char. The only difference is between their size which is 4 bytes in case of wchar_t which is 1 byte in char data ype. Wide characters are used mainly to represent non-English or exotic character sets. Moreover in your code explicitly preceding string literal … | |
hi all. i have implemented Karatsuba algorithm for multiplication of large numbers . when i compile .c file it is giving correct output using followin commands in **linux** terminal. **gcc ulti.c ./a.out < hi.txt** But problem arises when i try to run it in **ARM** using following commands. it give … | |
i am getting weird result here. if condition at line 25 is satisfied only 4 times while reading cpuinfo but **cores** is modified each time while loop iterates. i am not able to think of anything that may cause this. any help of any sort is appreciated. #include <stdio.h> #include … | |
evrything was fine until i inserted 100 to 125 lines in code. i am wondering what kv is doing wrong as it is not even printing that version file was opened.. any sort of help is appreciated. files included in the code are given below for reference. proc/version file: ** … | |
i want to ask if i can take input from .txt file to run a source file(.s) **using arm-elf-run abc.s** hi.txt. but giving hi.txt is not working like in c ./a.out hi.txt. any help whatsoever is appreciated. | |
Terminal shows foloowing error on entering command for "post review". "Unable to find a Review Board server for this source code tree". can you suggest how to set review board server url. | |
i searched a llot but in vain. can anyone help me with how to include code written using GTK+ as module in a code that uses wxpython as toolkit. any help whatsoever is appreciated. | |
we can use $_GET method to pass info via url but it shows the info in url like <a href =profile.php?id=$user>click here</a> and in profile.php?id=$user , we can access username via $username=$_GET['id']; is there any safer method to achieve because i don;t want to show the info passed in url. … | |
everything is workin except window.location .can any one suggest reason for it. thank you in anticipation <?php session_start(); $_SESSION["visiting"]=$_GET['userid']; echo $_SESSION["visiting"]." ".$_GET['userid']; ?> <script type="text/javscript"> window.location="http://localhost/fi.php"; </script> | |
i am ensuring on both pages i have first of all called session_start(); on one page i declared $_SESSION["username"]=$username; the link of another page is on this page. and another page i tried to print it by echo $_SESSION["username"]; but it showed nothing. i am using php 5.4 with apache … | |
i am trying to print " in echo statement. i can't get any method other than <?php echo " " "; ?> which is definitely wrong. help me to find a way out of it. any help is appreciated. | |
Re: google it man. i can't get how this post would be useful for the forum. | |
hi i am new to [B]socket programming[/B] and we have to do a project in a month. can u suggest some good project objectives which will look on CV. any help is highly appreciated. | |
Re: you should first try on your own. we will help u if you are stuck somewhere but first take first step. u shouldn't expect it to be spoonfed to you. | |
here, there are two functions in branchpredictor class namely predictor and trainer. [B]what i have pointed out is that predictor is working fine but trainer is not updating the variables of the above class. is it that only first function can access the variables. [/B] if not, can any one … | |
i actually learned java only a day ago and we have to submit assignment after two days. i wanted to figure out what i did here with class and function definition is correct. if correct can you help me out with the compilation error. in fact all are similar. it … | |
i dont know whats wrong with this program...the compiler compiles the program but when i run it it shows: j[B]ohnrambo@ubuntu:~/Desktop$ java lora Exception in thread "main" java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:443) at lunda.l2read(lora.java:24) at lora.main(lora.java:124)[/B] [CODE] class lunda{ String[] la=new String[2048]; String[] lb=new String[2048]; int[] lvalid_a=new int[2048]; int[] lvalid_b=new int[2048]; int[] … | |
can anybody help me what is wrong in syntax of following [CODE]ihex=Integer.parseInt(s5,16); String bin=Integer.toBinaryString(ihex); System.out.println(bin); if(bin.length()-10 > 0) String orgpc=bin.substring(bin.length()-10); else String orgpc=new String(bin);[/CODE] this is what compiler shows [B]nchy@ubuntu:~/Desktop$ javac bpbc.java bpbc.java:61: error: Syntax error on token "orgpc", delete this token String orgpc=bin.substring(bin.length()-10); ^^^^^ bpbc.java:63: error: Syntax error, insert … | |
i have two array of chars of size 12 each having only 0's or 1's. what i am trying to do is that in for loop [CODE]for(i=0;i<12;i++) { int a=1starray[i]; int b=2ndarray[i]; int c=a^b }[/CODE] but every time c gets 0 only. iam not getting it why. can anybody help … | |
i am wondering what is the problem here. here text.txt is the input file. any help will be highly appreciated. [CODE]import java.io.*; public class Main{ public static void main(String[] args) throws Exception { File f= new File("text.txt"); BufferedReader in = new BufferedReader( new FileReader(f)); String line = new String(); line … | |
i am quite new to java i used to code in c++ but now we have to program in java which has not been taught. i browsed net but casn't get enough information this is my first code which i managed to get from net [B]i am using GNU java … | |
Re: at line 27, u should not write x=(a+b)/2. it should work fine after this ammendment | |
can somebody help me out by providing link to the stuff related to buffer reader in java to read a trace file and store it in array of string. | |
what's wrong with it compiler shows: [B]cor.cpp:6:10: error: cannot convert ‘int (*)[10]’ to ‘int**’ in initialization[/B] is it like b is a pointer that is an array of 10 1d arrays i.e, rows. but what shall we write at line 6 to get rid of it. [CODE]#include <iostream> using namespace … | |
i don't know why but my compiler reads only upto insert statement. this is what compiler looks like: [B]nchy@ubuntu:~/Desktop$ g++ tree.cpp nchy@ubuntu:~/Desktop$ ./a.out 2 insert 0 14 10 85 15 70 20 60 30 50 65 80 90 40 5 55[/B] [COLOR="Red"]i want to implement following input format[/COLOR] 2 insert … ![]() | |
my insert function of redblack tree is working good for input checks listed as comments in main() say for 10 to 20 numbers which has included all types of color changes and rotations.. i am providing input of 1000 numbers to be inserted from input file "in 0" attached. i … | |
i am working with g++ in linux ubuntu i am attaching input file for which error occurred. this file tries to insert 1000 numbers and then 250th smallest number. this code worked well when i inserted less numbers but it is not working for insertion of 1000 numbers. compiler shows … | |
hi all!! i wanted to know the name of book which covers all the basic syntax and concepts of java keeping in mind that i have the basics of c++. | |
don't go by the size of code. [U]before inserting search function my code was working fine with insert function. but don't know what is wrong with search fn. or declaration of variables in main().[/U] [B]this is what compiler shows. tree.cpp:316:15: error: cannot convert ‘int*’ to ‘redblacktree<int>*’ in assignment tree.cpp:318:15: error: … | |
[COLOR="Red"][B]this is what compiler shows[/B][/COLOR] tree.cpp: In member function ‘void redblacktree<T>::insert(T) [with T = int]’: tree.cpp:187:12: instantiated from here tree.cpp:103:9: error: lvalue required as left operand of assignment tree.cpp:140:9: error: lvalue required as left operand of assignment [COLOR="Red"][B]if u don't want 2 go thru' d code then kindly just tell … | |
i have included just insert function in redblacktree class. there are[U] no compilation errors but it shows [COLOR="Red"]segmentation fault[/COLOR] [/U]on running. when i am calling insert function [B]it's not even entering into it as it's not printing the cout statement [/B]at first line of insert body. i am using g++ … |
The End.