[Solved] Why am I getting an undefined reference error while using separate .cpp and .h files for a class?

In your second and final step, you didn’t instruct the compiler (linker more exactly) to take into account Adder.o, so your final executable still doesn’t know the implementation of Adder::add Try, after getting Adder.o, to run g++ main.cpp Adder.o Also, this may be relevant : Difference between compiling with object and source files Also, if … Read more

[Solved] List to List

If I understand right you just want to determine which list has to be filled up depending on the datetable result set. So, when calling the function why don’t add (help)-parameter which determines where it was called from and depending on this variable the function will know what list to use. solved List to List

[Solved] how to stop Directory.CreateDirectory creating parents?

List<string> missingDirectories = null; private void MakeParents(string path) { missingDirectories = new List<string>(); missingDirectories.Add(path); parentDir(path); missingDirectories = missingDirectories.OrderBy(x => x.Length).ToList<string>(); foreach (string directory in missingDirectories) { Directory.CreateDirectory(directory); } } private void parentDir(string path) { string newPath = path.Substring(0, path.LastIndexOf(Path.DirectorySeparatorChar)); if (!Directory.Exists(newPath)) { missingDirectories.Add(newPath); parentDir(newPath); } } this does it, the issue is that if you … Read more

[Solved] naming convention for function and structure names and according to ANSI C standard [closed]

ANSI C standard provides little in the way of conventions only rules. Function, type and variable identifiers may use any alphanumeric symbol A-Za-z0-9 and underscore _. Names may not begin with a number. This is not a convention but the definition for what a legal name may be. The only convention I am aware of … Read more

[Solved] Not All Code Paths Return A Value (C#)

Modify your addNumbers to return a value. Function signature states it returns int, so you must return int from the function. using System; public class Test { public static int addNumbers(int num1, int num2) { int result; result = num1 + num2; return result; } public static void Main() { int a = 2; int … Read more

[Solved] } Expected in Routine

Learning how to format code is a CRITICAL skill for writing code that works correctly. private void PathExist() { if (Directory.Exists(folderBrowserDialog.SelectedPath + @”\”)) { lblExist.Visible = false; Properties.Settings.Default.FirstTime = false; // Create a new instance of the Form2 class MainFrm MainForm = new MainFrm(); MainForm.Show(); Hide(); //This is where Visual Studio is telling me that … Read more

[Solved] Does this function I made correctly append a string to another string?

First, char *stuff_to_append_to[] is an array of pointers of undetermined length, that is not a valid parameter, as the last dimension of an array must be specified when passed to a function, otherwise, pass a pointer to type. Next, char **stuff_to_append is a pointer to pointer to char and is completely valid, but given your … Read more

[Solved] How to elevate privileges for child process

OK, this shouldn’t actually be too hard, provided that UAC is configured with the default settings. I believe that the reason CreateProcessWithLogonW() is failing is that the target executable requires elevation. If you instead run an executable that is not configured to require elevation, it should work. At that point, you are running in the … Read more

[Solved] How can i convert the string to int and count? [closed]

EDIT for this code to work X = string.Format(“Frame_X_{0} “, i + 1); Y = string.Format(“Frame_Y_{0} “, i + 1); int c = Convert.ToInt32(ExtractNumbers(X));//modfied code line int d = Convert.ToInt32(ExtractNumbers(Y));//modfied code line framesNumberX += c; framesNumberY += d; you need to extract number something like this static string ExtractNumbers( string expr ) { return string.Join( … Read more

[Solved] String.Format Issue [closed]

Is this working? string s = “$(\”#container\”).notify();$(\”#container\”).notify(\”create\”, \”basic-template\”, {{ title: ‘{0}’, text: ‘{1}’}},{{ expires: false, speed: 1000 }});” 1 solved String.Format Issue [closed]

[Solved] Remove some specific string with special character

You can use this regex, \s+\[.*(?=\b\d+) and replace it with empty string. You start with one or more whitespace then match a [ using \[ and then .* consumes all the characters greedily and only stops when it sees a number using positive look ahead (?=\b\d+) Regex Demo 0 solved Remove some specific string with … Read more